kit: [Issue] Cannot redefine property: crypto

possible solution

https://github.com/sveltejs/kit/issues/10252#issuecomment-1611483919

Describe the bug

When I create a new project in svelte using these commands:

npm create svelte@latest my-app
cd my-app
npm install
npm run dev -- --open

I get this issue | image

Reproduction

When I create a new project in svelte using these commands:

npm create svelte@latest my-app
cd my-app
npm install
npm run dev -- --open

Logs

No response

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics
    Memory: 829.25 MB / 7.36 GB
  Binaries:
    Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.1848.0)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.0
    @sveltejs/kit: ^1.20.4 => 1.20.5
    svelte: ^4.0.0 => 4.0.0
    vite: ^4.3.6 => 4.3.9

Severity

blocking all usage of SvelteKit

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 15
  • Comments: 32 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Have same issue with node v16.19.0 but Fixed this by updating to lates node v20.3.1.

To everyone affected by this: Do you have the “Console Ninja” extension installed by any chance? If so, this might be the culprit, as hinted by this related issue. If so, try updating the extension to the latest version, then delete your node modules folder in the offending project and reinstall the packages, which hopefully fixes this.

Closing this since the issue was external and is now fixed. For future googlers – upgrade Console Ninja, remove node_modules, and reinstall.

@DoisKoh @dagthomas @AntonPavlenkov Have you freshly installed the node on your system or it was previously installed?

I had an ongoing project, everything was previously installed. Happened from Friday to Monday where it didn’t work anymore, unless I installed node 20

Broken on NodeJS v18.14.0 | Windows 11 for me.

Updated to NodeJS v20.3.1 | Windows 11 and the error went away.

@AntonPavlenkov - Thank you very much. The latest node v20.3.1 resolved the issue for me.