-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@sveltejs/adapter-node failure due to ES version #1667
Comments
I think a better fix for this would be to add |
Sounds like a plan, I haven't investigated the codebase too much so this was the easiest workaround I could find with my limited knowledge. |
Will that work on older versions of Node? #772 (comment) |
Hm. Is there something we could do instead of Edit: Oh, I guess it's TypeScript that's compiling |
Okay, it is esbuild that's displaying this warning, because it's looking at We can use the This is a little hacky, but I think this is a better solution than changing |
I think there's actually a much simpler way of achieving this same result: by explicitly setting The question then is whether that's safe to do. I don't think I have an answer to that. As far as I know, all of the user's code would already be going through TypeScript, and so would be getting compiled to ES2019, and the code being introduced by the adapter works on Node 12 (despite using some ES2020 features, like We may have to eventually drop es2019 / Node 12 support, but for now, what we have is definitely broken on all versions of Node because of the es2019/es2020 mismatch and the reliance on |
Specifying |
I wonder if that would also start letting us convert some SvelteKit code to use |
Even if we changed the |
I've opened #1675 with the |
Tried it out and can confirm that it fixes the issue for me. I have |
This should be fixed now in version 1.0.0-next.26 of the Node adapter. |
@Conduitry I still have the issue 1.0.0-next.27
Node: Build
Run
|
Describe the bug
When creating the skeleton project with TypeScript and using
@sveltejs/adapter-node
, the build succeeds with warnings and fails to run when usingnode build
.Logs
Build warning
Run error
To Reproduce
@sveltejs/adapter-node
as a dev dependencysvelte.config.js
to use the adapternpm run build
node build
Expected behavior
The server runs as expected when using
node build
Stacktraces
Stack trace
Information about your SvelteKit Installation:
Diagnostics
Severity
I found a workaround:
Update the
tsconfig.json
and change the target to match the target version specified in@sveltejs/adapter-node
. I suspectes2020
should be used for SvelteKit and the adapter to work together as expected.The text was updated successfully, but these errors were encountered: