SolidJSS
SolidJSโ€ข2y agoโ€ข
7 replies
Joe Pea

how to change solid-start build `target`?

I tried this in app.config:

export default defineConfig({
  extensions: ["mdx", "md"],
  vite: {
    build: { target: "esnext" },
  },
})


but when I put a top-level await in a module, then npm run build says this:

 ERROR  Transform failed with 1 error:                                                                               10:24:53 AM
/Users/trusktr/src/showcase/.vinxi/build/ssr/ssr.js:1:17460: ERROR: Top-level await is not available in the configured target environment ("es2019")


The top-level await is working fine in npm run dev, but I get that error only with build.

How do we change the target?
Screenshot_2024-08-24_at_10.54.57_AM.png
Was this page helpful?