-
Notifications
You must be signed in to change notification settings - Fork 88
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
Building with esnext target causes server to not be runnable #179
Comments
Any error messages or logs ? Need more info |
There appears to be no error messages or logs. Here's a reproduction: https://stackblitz.com/edit/vinxi-test?file=src%2Frouter.tsx The top-level await happens in src/router.tsx in Run Running |
I'm also able to run my solid start project in dev, but building and running production just exits without any message. |
Is this an esbuild limitation? evanw/esbuild#253 |
in my case.when set target to esnext or support top-level-await,it can build but can't start
look at compiled code globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};
//...
var __filename = fileURLToPath(globalThis._importMeta_.url); it seems that esbuild doesn't handle even if I set const serverConfig = {
esbuild: {
options: {
supported: {
'top-level-await': true,
'import-meta': true,
},
},
},
} I remove all |
I was looking to use top-level await in my application which appears to only be available on targets ES2022/ESNext. The server built by default targets ES2019.
app.config.ts
:Running
node .output/server/index.mjs
on the built output causes the server to exit immediately on startup. I am using Node v18.16. In dev mode, the application runs fine.The text was updated successfully, but these errors were encountered: