T
TanStack3mo ago
other-emerald

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',
}),
],
})
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")
ERROR: Top-level await is not available in the configured target environment ("es2019")
2 Replies
correct-apricot
correct-apricot3mo ago
probably would need to be forwarded. can you please create a github issue for this?
other-emerald
other-emeraldOP3mo ago
ok 👍

Did you find this page helpful?