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
There's an import error on startup after npm init svelte@next and yarn run dev with yarn3.
This looks like the same error message as #2161 but the issue seems different. I hope this is the correct repository for reporting this issue.
Reproduction
Commands without output (except the last):
(base) ➜ npm init svelte@next my-app
(base) ➜ cd my-app
(base) ➜ my-app yarn set version berry
(base) ➜ my-app yarn
/home/erg/my-app/.yarn/__virtual__/@sveltejs-kit-virtual-e79fbd740b/0/cache/@sveltejs-kit-npm-1.0.0-next.165-3f2325a2a6-6fd796f1e6.zip/node_modules/@sveltejs/kit/svelte-kit.js:2
import './dist/cli.js';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.external_module_.Module._load (/home/erg/my-app/.pnp.cjs:10817:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47
Logs
Initial command:
# Answer defaults to the npm init questions (no/no/no/no)
(base) ➜ ~ npm init svelte@next my-app
create-svelte version 2.0.0-next.78
Welcome to SvelteKit!
This is beta software; expect bugs and missing features.
If you encounter a problem, open an issue on https://github.com/sveltejs/kit/issues if none exists already.
✔ Which Svelte app template? › SvelteKit demo app
✔ Use TypeScript? … No / Yes
✔ Add ESLint for code linting? … No / Yes
✔ Add Prettier for code formatting? … No / Yes
✔ Copied project files
Want to add other parts to your code base? Visit https://github.com/svelte-add/svelte-adders, a community project of commands to add particular functionality to Svelte projects
Next steps:
1: cd my-app
2: npm install (or pnpm install, etc)
3: git init && git add -A && git commit -m "Initial commit" (optional step)
4: npm run dev -- --open
To close the dev server, hit Ctrl-C
Stuck? Visit us at https://svelte.dev/chat
Next command:
(base) ➜ ~ cd my-app
(base) ➜ my-app yarn set version berry
warning package.json: No license field
Resolving berry to a url...
Downloading https://github.com/yarnpkg/berry/raw/master/packages/berry-cli/bin/berry.js...
Saving it into /home/erg/my-app/.yarn/releases/yarn-berry.cjs...
Updating /home/erg/my-app/.yarnrc.yml...
Done!
(base) ➜ my-app yarn
➤ YN0000: ┌ Resolution step
yarn run de➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
v
➤ YN0000: └ Completed in 2s 505ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ vite@npm:2.5.6 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ which@npm:2.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ wide-align@npm:1.1.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ wrappy@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yallist@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 0s 274ms
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.12.25 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 0s 211ms
➤ YN0000: Done with warnings in 3s 10ms
(base) ➜ my-app yarn run dev
/home/erg/my-app/.yarn/__virtual__/@sveltejs-kit-virtual-e79fbd740b/0/cache/@sveltejs-kit-npm-1.0.0-next.165-3f2325a2a6-6fd796f1e6.zip/node_modules/@sveltejs/kit/svelte-kit.js:2
import './dist/cli.js';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.external_module_.Module._load (/home/erg/my-app/.pnp.cjs:10817:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47
Describe the bug
There's an import error on startup after
npm init svelte@next
andyarn run dev
with yarn3.This looks like the same error message as #2161 but the issue seems different. I hope this is the correct repository for reporting this issue.
Reproduction
Commands without output (except the last):
Logs
Next command:
After setting yarn to berry:
The text was updated successfully, but these errors were encountered: