When I git push and netlify starts building my sapper app I keep getting failed builds due to netlify not recognizing that JS optional chaining operators exist…dunno why…
If I build myself and manually deploy to Netlify it works just fine…
I will have on optional chaining operator in my code somewhere , like this:
let overlay = scales[scaleName]?.overlay;
…and during the deployment build netlify will fail with an error like this:
…just to reiterate, when I run the same command ‘npm run export’ on my local machine it all works just fine, I then drag and drop the folder manually into netlify and it runs just fine, and if I comment out the optional chaining operators, then it builds just fine inside netlify…
It seems as if the sapper build process inside of netlify simply does not know what optional chaining operators are…i guess…
Sorry for the delayed response here. Welcome to the Netlify Forums
Is this still an ongoing issue for you? If it has been resolved in the past 8 days, please let us know! If it is still occurring, please confirm and I will share this thread with a member of our team who is more familiar with Sapper.
Hey there! If it’s working locally but not remotely, are you ensuring that your versions locally and remotely match? You might find this guide useful as starters-for-10!
So, I git push to github and that kicks off the build process of one version of the site, where the build fails in netlify. I then immediately run npm run export on my local machine and take the output folder and drag and drop that folder onto another version of the site in netlify and that works just fine…not sure if that is what you meant by the versions being the same?
If you mean the node version…I don’t understand the instructions here:
I’m running Node 15.11.0 on my machine, which is far far newer than 12.18.0, so maybe that’s the issue?
Anyway, if that is the case, I don’t know how to ‘set the node.js environment’ to something else, or really any of the instructions in that section…
If you have any more clarification for me that would be great