N
Nuxt6mo ago
Fleny

Nitro build warning on ESM and this

Hi, when trying to build my application after Nuxt logs Building Nuxt Nitro server (preset: node-server) i get a bunch of warnings from files in the node_modules (specificly files from arktype and @arktype/schema) like these:
node_modules/.pnpm/[email protected]/node_modules/arktype/out/scope.js (1:25): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
[...]
node_modules/.pnpm/@[email protected]/node_modules/@arktype/schema/out/roots/alias.js (8:28): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
node_modules/.pnpm/[email protected]/node_modules/arktype/out/scope.js (1:25): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
[...]
node_modules/.pnpm/@[email protected]/node_modules/@arktype/schema/out/roots/alias.js (8:28): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
(there a bunch of them, it would be too long to list them all) Checking the arktype build output it has the TS helpers that TSC would emit and those use this that ESBuild(?) seems to not be so happy with The built server seems to work fine, however the warns are a bit annoying. Also another thing that is quite strange, while i can get the warns when using Windows, trying in WSL and StackBlitz it does not warn. pnpm nuxi info:
- Operating System: Windows_NT
- Node Version: v22.2.0
- Nuxt Version: 3.12.2
- CLI Version: 3.12.0
- Nitro Version: 2.9.6
- Package Manager: [email protected]
- Builder: -
- User Config: devtools
- Runtime Modules: -
- Build Modules: -
- Operating System: Windows_NT
- Node Version: v22.2.0
- Nuxt Version: 3.12.2
- CLI Version: 3.12.0
- Nitro Version: 2.9.6
- Package Manager: [email protected]
- Builder: -
- User Config: devtools
- Runtime Modules: -
- Build Modules: -
repro repo: https://github.com/Fleny113/arktype-nuxt-repro (the server/api/test.post.ts file has the arktype validation)
1 Reply
Fleny
FlenyOP6mo ago
bump, has anyone any idea?
Want results from more Discord servers?
Add your server