-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Closed
Labels
Description
Describe the bug
I simply installed a React TypeScript project using pnpm create vite and tried to run it, but encountered the following error. I'm on a Windows environment and using Node.js version v20.9.0. This issue didn't occur before, so it seems to be related to the recent update to Vite version 7.0.
G:\project>pnpm create vite
|
o Project name:
| vite-sample
|
o Select a framework:
| React
|
o Select a variant:
| TypeScript
|
o Scaffolding project in G:\project\vite-sample...
|
— Done. Now run:
cd vite-sample
pnpm install
pnpm run dev
G:\project>cd vite-sample
G:\project\vite-sample>pnpm install
Packages: +188
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 232, reused 188, downloaded 0, added 188, done
dependencies:
+ react 19.1.0
+ react-dom 19.1.0
devDependencies:
+ @eslint/js 9.29.0
+ @types/react 19.1.8
+ @types/react-dom 19.1.6
+ @vitejs/plugin-react 4.6.0
+ eslint 9.29.0
+ eslint-plugin-react-hooks 5.2.0
+ eslint-plugin-react-refresh 0.4.20
+ globals 16.2.0
+ typescript 5.8.3
+ typescript-eslint 8.35.0
+ vite 7.0.0
╭ Warning ───────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Ignored build scripts: esbuild. │
│ Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────╯
Done in 2.7s using pnpm v10.5.1
G:\project\vite-sample>pnpm run dev
> [email protected] dev G:\project\vite-sample
> vite
error when starting dev server:
TypeError: crypto.hash is not a function
at getHash (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-Bsx9IwL8.js:2834:21)
at getLockfileHash (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-Bsx9IwL8.js:11716:9)
at getDepHash (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-Bsx9IwL8.js:11719:23)
at initDepsOptimizerMetadata (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-Bsx9IwL8.js:11180:53)
at createDepsOptimizer (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-Bsx9IwL8.js:34593:17)
at new DevEnvironment (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-Bsx9IwL8.js:35357:109)
at Object.defaultCreateClientDevEnvironment [as createEnvironment] (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-Bsx9IwL8.js:35776:9)
at _createServer (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-Bsx9IwL8.js:28359:132)
at async CAC.<anonymous> (file:///G:/project/vite-sample/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/cli.js:573:18)
ELIFECYCLE Command failed with exit code 1.
Reproduction
.
Steps to reproduce
No response
System Info
windows, node v20.9.0Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Leni-Vienne, BasemHamad, LiMao00, Srimc05, novogrammer and 25 more