Skip to content
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

When i run npm run dev on my react project i get an error that has happened in a similar manner to astro #365

Closed
7 tasks done
tolubori07 opened this issue Sep 15, 2024 · 1 comment

Comments

@tolubori07
Copy link

Describe the bug

I am running npm run dev to start my react server, however i get this error all the time [vite] Internal server error: Cannot redefine property: File Plugin: vite:react-babel File: /Users/moshoodbello/Coding/NEA/frontend/src/main.jsx at Function.defineProperty (<anonymous>) at Object.<anonymous> (/Users/moshoodbello/Coding/NEA/frontend/node_modules/@babel/core/lib/index.js:7:8) at Module._compile (node:internal/modules/cjs/loader:1241:14) at Module._extensions..js (node:internal/modules/cjs/loader:1295:10) at Module.load (node:internal/modules/cjs/loader:1091:32) at Module._load (node:internal/modules/cjs/loader:938:12) at Module.require (node:internal/modules/cjs/loader:1115:19) at require (node:internal/modules/helpers:130:18) at Object.<anonymous> (/Users/moshoodbello/Coding/NEA/frontend/node_modules/@babel/core/lib/config/helpers/config-api.js:16:14) at Module._compile (node:internal/modules/cjs/loader:1241:14)
Another thing that might be of help is that a similar problem occurred with astro, I would've assumed this was an issue with astro but it then happened to react so i assume that this might be a vite issue?

Reproduction

/

Steps to reproduce

I Run npm run dev

System Info

System:
    OS: macOS 14.6.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 1.09 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.6.0 - ~/node_modules/.bin/node
    npm: 10.8.2 - /usr/local/bin/npm
    bun: 1.1.20 - ~/.bun/bin/bun
  Browsers:
    Chrome: 128.0.6613.138
    Safari: 17.6
  npmPackages:
    @vitejs/plugin-react: ^4.3.1 => 4.3.1 
    vite: ^5.4.0 => 5.4.0

Used Package Manager

npm

Logs

Plugin: vite:react-babel
File: /Users/moshoodbello/Coding/NEA/frontend/src/main.jsx
at Function.defineProperty ()
at Object. (/Users/moshoodbello/Coding/NEA/frontend/node_modules/@babel/core/lib/index.js:7:8)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object. (/Users/moshoodbello/Coding/NEA/frontend/node_modules/@babel/core/lib/config/helpers/config-api.js:16:14)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
vite:time 27.31ms /src/main.jsx +243ms
vite:load 22.26ms [fs] /@vite/client +6ms
vite:resolve 1.54ms @vite/env -> /Users/moshoodbello/Coding/NEA/frontend/node_modules/vite/dist/client/env.mjs +33ms
vite:import-analysis 8.88ms [1 imports rewritten] node_modules/vite/dist/client/client.mjs +0ms
vite:transform 13.29ms /@vite/client +0ms
vite:time 38.32ms /@vite/client +16ms
vite:load 2.80ms [fs] /node_modules/vite/dist/client/env.mjs +16ms
vite:import-analysis 0.07ms [no imports] node_modules/vite/dist/client/env.mjs +3ms
vite:transform 0.58ms /node_modules/vite/dist/client/env.mjs +2ms
vite:import-analysis 0.85ms [0 imports rewritten] /@react-refresh +3ms
vite:transform 39.91ms /@react-refresh +3ms
vite:time 41.79ms /@react-refresh +6ms
vite:cache [304] /node_modules/vite/dist/client/env.mjs +0ms
vite:time 0.44ms /node_modules/vite/dist/client/env.mjs +11ms

Validations

@hi-ogawa
Copy link
Collaborator

This looks like an issue with Node 20.6.0 specifically

Can you try it again after updating node?

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

No branches or pull requests

2 participants