T
TanStack6mo ago
rising-crimson

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
extended-salmon
extended-salmon6mo ago
probably would need to be forwarded. can you please create a github issue for this?
rising-crimson
rising-crimsonOP6mo ago
ok 👍

Did you find this page helpful?