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

./node_modules/@phosphor-icons/react/dist/lib/context.mjs Can't import the named export 'createContext' from non EcmaScript module (only default export is available) #89

Open
shreyas-aw opened this issue Apr 2, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@shreyas-aw
Copy link

Describe the bug

Unable to build the project after doing npm install with latest build v2.1.4

Steps to Reproduce

Install v2.1.4 and try to run react project you will find the issue in console

./node_modules/@phosphor-icons/react/dist/lib/context.mjs
Can't import the named export 'createContext' from non EcmaScript module (only default export is available)

Expected behavior

No error should be reported in console or in browser. It should work as normal.

Screenshots

image image

Context (please complete the following information):

  • OS: Windows 11 Home
  • Browser: Chrome
  • Library: @phosphor-icons/react
  • Version: v2.1.4
@shreyas-aw shreyas-aw added the bug Something isn't working label Apr 2, 2024
@shreyas-aw
Copy link
Author

Failed at Vercel as well

image

@shreyas-aw
Copy link
Author

@rektdeckard Sorry to bother, but do you have any update on this bug ?

@anu2308
Copy link

anu2308 commented May 18, 2024

Any update on this bug? Any solution? facing the same problem with exact same error message and configuration.

@rektdeckard
Copy link
Member

@shreyas-aw I assume this is a Nextjs app, because Vercel and thats the only kind of bug reports we get here anymore. Can you share your Next version and example of usage? Are you using the ssr version of the icons, and how are you importing them? If not, are the csr icons being used in client components?

@rektdeckard
Copy link
Member

A minimal reproduction would be appreciated.

@anu2308
Copy link

anu2308 commented May 18, 2024

@rektdeckard Am using "@phosphor-icons/react": "^2.0.5" csr and using react for frontend...

@anu2308
Copy link

anu2308 commented May 19, 2024

@rektdeckard Am using "@phosphor-icons/react": "^2.0.5" csr and using react for frontend...

I solved the issue, the problem was with my package.json using react script version 3.4+, I updated it to version 5.+ and it worked

@shreyas-aw
Copy link
Author

@anu2308, I am already pointing to "react-scripts": "^5.0.1" but still received error, if possible can you please paste your package.json file here.

@shreyas-aw
Copy link
Author

@shreyas-aw I assume this is a Nextjs app, because Vercel and thats the only kind of bug reports we get here anymore. Can you share your Next version and example of usage? Are you using the ssr version of the icons, and how are you importing them? If not, are the csr icons being used in client components?

Sorry @rektdeckard, it is a react app.

@danihml-triibo
Copy link

anyone has solved this problem? I'm facing the same issue here.

React App v17, Node v16. Only the legacy version (phosphor-react import) is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants