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

Component import problem #12

Closed
hakancunier opened this issue Sep 24, 2022 · 11 comments
Closed

Component import problem #12

hakancunier opened this issue Sep 24, 2022 · 11 comments

Comments

@hakancunier
Copy link

hakancunier commented Sep 24, 2022

Last day i updated my npm packages and got this error:

./node_modules/its-fine/dist/index.mjs
Can't import the named export 'Component' from non EcmaScript module (only default export is available)

@CodyJasonBennett CodyJasonBennett added the bug Something isn't working label Sep 24, 2022
@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Sep 24, 2022

Which tool are you using for this? Webpack? It would help to know which and what version.

@abhi-dasgupta
Copy link

i started getting this too.. simply by deleting node_modules and running npm i

@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Sep 26, 2022

Some basic information about your environment would go a long way to solving this. See the above, a repository recreating the issue would be ideal.

@abhi-dasgupta
Copy link

ok so this is hot i ended up here.

  1. developing with create-react-app
  2. faced this issue Uncaught ReferenceError: process is not defined (NOT react-error-overlay) facebook/create-react-app#12212
  3. did what is suggested there and in similar issues, one of steps is downgrading react-scripts
  4. previous errors go away and now I get this error
    has nothing to do with my code, everything was working fine, until today with npm i ...

@CodyJasonBennett
Copy link
Member

Downgrading react-scripts puts you to v4 which does not understand Node ESM (related: facebook/create-react-app#10356). Could you try with a clean install on v5?

@abhi-dasgupta
Copy link

sorry my bad, i get a different set of errors with v4 with v5.0.1 I get the below error on start
./node_modules/its-fine/dist/index.mjs
Can't import the named export 'Component' from non EcmaScript module (only default export is available)

all packages
"@emotion/react": "^11.10.4",
"@emotion/styled": "^11.10.4",
"@mui/icons-material": "^5.10.6",
"@mui/material": "^5.10.6",
"@react-three/drei": "^9.32.1",
"@react-three/fiber": "^8.8.2",
"@react-three/postprocessing": "^2.6.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"moment": "^2.29.4",
"nanoid": "^4.0.0",
"nipplejs": "^0.9.1",
"react": "^18.2.0",
"react-animated-cursor": "^2.5.1",
"react-dom": "^18.2.0",
"react-favicon": "^1.0.1",
"react-ga": "^3.3.1",
"react-joyride": "^2.5.3",
"react-scripts": "5.0.1",
"simple-peer": "^9.11.1",
"socket.io-client": "^4.5.2",
"three": "^0.144.0",
"use-sound": "^4.0.1",
"web-vitals": "^2.1.4"

@CodyJasonBennett
Copy link
Member

I published a workaround in v1.0.3. Can you try another clean-install (remove lockfiles, node_modules)?

@CodyJasonBennett
Copy link
Member

Alright, I bumped its-fine in v8.8.5 of react-three-fiber if you could try now.

@abhi-dasgupta
Copy link

yes everything is working now. Thank you for looking into it

@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Sep 27, 2022

@hakancunier let me know if there are any withstanding issues on your end. This looks to be resolved between CRA and vanilla Webpack with the work around from #14.

@hakancunier
Copy link
Author

hakancunier commented Sep 27, 2022

Hello. I got it working by upgrading react-scripts ^5.0.1. Thank you again.

@CodyJasonBennett CodyJasonBennett removed the bug Something isn't working label Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants