Skip to content

SvelteKit won't start due to "SyntaxError: Cannot use import statement outside a module" #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zicho opened this issue Mar 28, 2021 · 3 comments

Comments

@zicho
Copy link

zicho commented Mar 28, 2021

I am trying to start up a new SvelteKit project using the tutorial found on https://svelte.dev/blog/sveltekit-beta

After install, it gives the following message after running "npm run dev -- --open"

path\to\project\node_modules\@sveltejs\kit\svelte-kit.js:2
import './dist/cli.js';
^^^^^^

SyntaxError: Cannot use import statement outside a module

I have tried with different settings, such as turning TypeScript, ESLint and prettier off and on, but it doesnt seem to change anything, I still get the same issue.

@dummdidumm
Copy link
Member

Which node version are you using? You need at least 12.

@zicho
Copy link
Author

zicho commented Mar 28, 2021

Confirmed working after node update

@zicho zicho closed this as completed Mar 28, 2021
@kinxiel
Copy link

kinxiel commented Mar 30, 2021

Had the same issue using node 12.14.1, updated to 15.12.0 and confirmed working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants