-
Notifications
You must be signed in to change notification settings - Fork 2.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Server Side Top Level Await does not work #4348
Comments
The error message seems quite self-explanatory: top level await are not available for node14. |
Problem is largely here, remix build doesn't allow you to configure any other target. I'll reference the two files responsible. remix/packages/remix-dev/build.ts Lines 15 to 20 in 42fb183
remix/packages/remix-dev/compiler.ts Line 75 in b35e135
remix/packages/remix-dev/compiler.ts Line 105 in b35e135
I've thrown together a fork which bumps every reference to >= Node 14 to >= Node 14.8 and it seems to be working. The large problem is the actual ESBuild target used by Remix isn't configurable. |
I'll admit this is a bit of a bandaid solution as it just bumps the Node requirement and the ESBuild target. Would it make more sense to expose the ESBuild options to the remix configuration file? We're going to keep having these problems otherwise as javascript syntax changes. |
I'm failing to see the issue here @joshocalico: If you want to be able to use TLA in your project, then you need to make sure you run it on a compatible node version. What am I missing? Opening the esbuild configuration to user land is a different topic, I think there's an open discussion about it. |
@machour I think it'd be a bit obvious from what I've posted and the code quoted. |
Would be great to have more modern Node support from Remix. Any update @machour? |
@jgentes someone from the Remix team will eventually pick this up, I'm just volunteering for triage. |
I think this may have been addressed by #4034? |
@mcansh is that the case? |
Converting this to a Proposal discussion, as per our Development Process. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
What version of Remix are you using?
Latest (1.7.1)
Steps to Reproduce
Use this export in any loader or server file.
Note: this doesn't apply to client side Javascript/Typescript as Remix rightfully respects the tsconfig / jsconfig.
Expected Behavior
It will evaluate the promise inside the module while it is being imported.
Actual Behavior
The app doesn't build.
The text was updated successfully, but these errors were encountered: