-
-
Notifications
You must be signed in to change notification settings - Fork 427
Occurrence of optional chaining operator not getting replaced #1423
Comments
Svelte recently added support for this sveltejs/svelte#1972 It's not yet supported in Closing this since it's not an issue in Sapper, but in an external library |
Oh, actually this request looks more like a question about how to setup your babel config for the legacy build to support this. I see someone did that in sveltejs/svelte#1972 (comment) which might be helpful to you |
What I actually meant was that just two lines above the error in my code (not visible in the snippet, sorry), the optional chaining operator was indeed replaced correctly, when it was used in a variable assignment. The untranspiled one is the one in the example above, when used inside ternary expression. But I guess |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Not sure if this is a thing, but I tried deploying to Netlify and the build failed due to
Unexpected token "."
in__sapper__/build/server/server.js
.It turned out that this piece of code ended up in the legacy bundle untranspiled:
While the optional chaining operator wasn't replaced in this snippet, a couple lines above it was replaced just fine, but there it was used in variable assignments.
To Reproduce
Use code snippet above and run
"export": "NODE_ENV=production sapper export --legacy"
Expected behavior
Optional chaining operator gets transpiled.
Information about your Sapper Installation:
Your browser: Brave Browser: 1.12.114
Your hosting environment: Local
If it is an exported (
npm run export
) or dynamic application: exported applicationSeverity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Sapper entirely?
Used
post && post.excerpt
instead, so neglectableThe text was updated successfully, but these errors were encountered: