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

"@phosphor-icons/react" was not found in your node_modules. Did you forget to install it? #44

Closed
hta218 opened this issue Mar 21, 2023 · 6 comments

Comments

@hta218
Copy link

hta218 commented Mar 21, 2023

Could this be the same issue as #41? I would appreciate any guidance on how to resolve this error.

Error message:

The path "@phosphor-icons/react" is imported in app/icons/index.ts but "@phosphor-icons/react" was not found in your node_modules. Did you forget to install it?

I'm using the package in a Remix app
Node version: v18.15.0
My package.json: "@phosphor-icons/react": "^2.0.6"

@rektdeckard
Copy link
Member

Could be. I have no experience with Remix, but it seems to be a known limitation that ESM-only packages are not supported in server files. Have you tried forcing this into client, per this section of their docs? https://remix.run/docs/en/1.14.3/pages/gotchas#md-importing-esm-packages

This is an ESM-only package at the moment, but I will try and push a UMD build at some point that should be compatible with Remix and anything else still stuck in the pre-ESM era. It boggles the mind that we are still dealing with NodeJS hangovers like this in 2023!

@hta218
Copy link
Author

hta218 commented Mar 21, 2023

Yeah, adding @phosphor-icons/react to the serverDependenciesToBundle array is ... somehow worked.
It still throws the error above but the server can be started (before, it kept crashing and the app couldn't be started)

Thank you for taking a look 🤝, guess I'll close this now.

@hta218 hta218 closed this as completed Mar 21, 2023
@vdineva
Copy link

vdineva commented Mar 22, 2023

@rektdeckard I'm experiencing similar issue in my project (not using Remix) - everything works well in the browser but our unit tests using Jest can't find the "@phosphor-icons/react" module. Seems like Jest's support for ESM modules is still in experimental phase: https://jestjs.io/docs/ecmascript-modules
When do you expect the UMD build to be available?

@rektdeckard
Copy link
Member

rektdeckard commented Mar 23, 2023

I will build and publish with the UMD bundle tomorrow @vdineva

@vdineva
Copy link

vdineva commented Mar 28, 2023

@rektdeckard any update on this?

@rektdeckard
Copy link
Member

v2.0.8 includes a UMD build, and should be compatible with CJS-based build tooling.

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