You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
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:
<metaname="description"
content="{segment ? post?.excerpt : 'Opinions and viewpoints about Programming, Lifestyle and other topics.'}"
/>
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"
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 rollup-plugin-terser is my best bet then ;)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: