Closed Chaffexd closed 1 year ago
Hello @Chaffexd. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction
will be closed if they have no activity within 3 days.
@Chaffexd How do you have solved that issue?
i found it. Do not use crypto as an npm package... it is deprecated and built in in Node JS. https://www.npmjs.com/package/crypto
Describe the bug
I'm using Vite as a scaffold for my project when out of nowhere it encountered an issue. I noticed when the live preview in browser stopped working.
The error is:
I've deleted the node module file as well as package-lock.json and clean installed, but encounter the issue straight away.
In the console:
Steps to repro: I just randomly encountered it.. was working fine before, I naturally started my project with: npm create vite@latest
Reproduction
Steps above
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
Click to expand
``` npm run dev 1 ↵ 1988 20:35:27 > multi-step-form@0.0.0 dev > vite Port 5173 is in use, trying another one... VITE v4.2.1 ready in 308 ms ➜ Local: http://127.0.0.1:5174/ ➜ Network: use --host to expose ➜ press h to show help ✘ [ERROR] Failed to resolve entry for package "crypto". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-pre-bundle] node_modules/esbuild/lib/main.js:1360:21: 1360 │ let result = await callback({ ╵ ^ at packageEntryFailure (file:///Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/vite/dist/node/chunks/dep-79892de8.js:23266:11) at resolvePackageEntry (file:///Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/vite/dist/node/chunks/dep-79892de8.js:23263:5) at tryNodeResolve (file:///Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/vite/dist/node/chunks/dep-79892de8.js:23000:20) at Context.resolveId (file:///Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/vite/dist/node/chunks/dep-79892de8.js:22762:28) at Object.resolveId (file:///Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/vite/dist/node/chunks/dep-79892de8.js:43314:46) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async file:///Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/vite/dist/node/chunks/dep-79892de8.js:63611:21 at async file:///Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/vite/dist/node/chunks/dep-79892de8.js:23589:34 at async requestCallbacks.on-resolve (/Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/esbuild/lib/main.js:1360:22) at async handleRequest (/Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/esbuild/lib/main.js:723:13) This error came from the "onResolve" callback registered here: node_modules/esbuild/lib/main.js:1279:20: 1279 │ let promise = setup({ ╵ ^ at setup (file:///Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/vite/dist/node/chunks/dep-79892de8.js:23569:19) at handlePlugins (/Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/esbuild/lib/main.js:1279:21) at buildOrContextImpl (/Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/esbuild/lib/main.js:968:5) at Object.buildOrContext (/Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/esbuild/lib/main.js:776:5) at /Users/chaffe/Documents/Code/JavaScript/personal/frontend-mentor-react/multi-step-form-main/multi-step-form/node_modules/esbuild/lib/main.js:2172:68 at new Promise (Validations