TanStackT
TanStack8mo ago
2 replies
spotty-amber

Is `build.target` no longer passed to `nitro` with 1.121.x

It seems to always be es2019 when the nitro plugin executes.

I reproduced this with the start-basic repo but not sure it's a bug or maybe a misunderstanding:


export default defineConfig({
  server: {
    port: 3000,
  },
  build: {
    target: 'es2022',
  },
  plugins: [
    tsConfigPaths({
      projects: ['./tsconfig.json'],
    }),
    tanstackStart({
      target: 'node-server',
    }),
  ],
})


It's visible if you add something incompatible like a top-level await. The logs will have:

ERROR: Top-level await is not available in the configured target environment ("es2019")
Was this page helpful?