router icon indicating copy to clipboard operation
router copied to clipboard

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

Open kevinehosford opened this issue 7 months ago • 0 comments

Which project does this relate to?

Start

Describe the bug

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

I reproduced this with the start-basic:

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")

Your Example Website or App

https://github.com/kevinehosford/start-build-target-bug

Steps to Reproduce the Bug or Issue

  • npx gitpick TanStack/router/tree/main/examples/react/start-basic start-basic
  • add top-level await import
  • specify build.target: es2022
  • npm run build

see a log message about the target being es2019

Expected behavior

The built.target to be what's specified in the config

Screenshots or Videos

Image

Platform

  • OS: macOS

Additional context

No response

kevinehosford avatar Jun 13 '25 22:06 kevinehosford