You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pnpm supports json5 for the package file but when i do that 'svelte-kit sync' no longer works
Reproduction
pnpm create svelte@latest my-app # create a typescript skeletonproject with all defaults
cd my-app
mv package.json package.json5
pnpm update # to have pnpm start using json5 syntax in the file
pnpm exec svelte-kit sync
(node:23795) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/christoph/Projects/temp/my-app/svelte.config.js:1
import adapter from '@sveltejs/adapter-auto';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1166:20)
at Module._compile (node:internal/modules/cjs/loader:1210:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1300:10)
at Module.load (node:internal/modules/cjs/loader:1103:32)
at Module._load (node:internal/modules/cjs/loader:942:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:168:29)
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
Node.js v19.6.0
pnpm may support JSON5, but Node itself still requires a package.json file with "type": "module" in order to interpret .js files as ESM. And pnpm is going to prefer the package.json file over the package.json5 file if they're both present (pnpm/pnpm#3027, pnpm/pnpm#5541). I'd suggest not using pnpm's JSON5 support for now (or even ever, maybe). There's not really anything SvelteKit can do about this for now.
Describe the bug
pnpm supports json5 for the package file but when i do that 'svelte-kit sync' no longer works
Reproduction
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: