I am creating a vite react project with npm create vite@lates but when i am running the development server it throws some error
i am using a windows 7 32 bit node 18.20.3 so it could be becouse of the old versions but the specific vite versions that used to work are also not working. The only method that i found useful was to copy all the nodemodules from a previous project and use it in my current project. I would highly appreciate your help.
This is the full log of the error
[vite] Internal server error: Cannot read properties of undefined (reading ‘0’)
Plugin: vite:import-analysis
File: C:/Users/Saroj/Desktop/New folder (2)/test/src/main.jsx
at transformCjsImport (file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:64305:40)
at interopNamedImports (file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:64277:23)
at file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:64066:19
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at async TransformPluginContext.transform (file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:63969:7)
at async PluginContainer.transform (file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:48974:18)
at async loadAndTransform (file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:51796:27)
9:34:13 AM [vite] Pre-transform error: Cannot read properties of undefined (reading ‘0’)
9:34:13 AM [vite] Internal server error: Cannot read properties of undefined (reading ‘0’)
Plugin: vite:asset-import-meta-url
File: C:/Users/Saroj/Desktop/New folder (2)/test/node_modules/vite/dist/client/client.mjs
at TransformPluginContext.transform (file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:48063:45)
at PluginContainer.transform (file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:48975:19)
at async loadAndTransform (file:///C:/Users/Saroj/Desktop/New%20folder%20(2)/test/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:51796:27)
9:34:13 AM [vite] Pre-transform error: Cannot read properties of undefined (reading ‘0’)
Saroj Thapa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.