Comments (5)
Thanks @pReya for flagging, and @adamtaylor13 for the fix and for the lovely writeup! v2.0.10 had been published with the type
field added.
from react.
@pReya I'm running into this as well. I took a look at your example, and it only actually seems to show the error once I added Smiley to the IconContainer—simply importing it did not seem to reproduce. I'm very curious what changed as well, because the legacy phosphor-react library worked fine with Astro.
Things I've tried
- Switching all imported instances of my react components to "client:only" directives so they aren't server-side rendered.
- Adding "use client" to my icon imports.
- Changing my
package.json
to"type": "module",
to no avail. - Adding
"module": "nodenext",
to my tsconfig.json - All the above in various orders / combinations.
All to no avail unfortunately. I'm going to just have to downgrade to using phosphor-react
for right now.
from react.
A workaround for me is currently to use the raw svg files and import them with https://github.com/pd4d10/vite-plugin-svgr as React components.
This problem might be fixed just by adding type: "module"
to the package.json of the @phosphor-icons/react
package.
from react.
This problem might be fixed just by adding type: "module" to the package.json of the @phosphor-icons/react package
@pReya Wow, no kidding, this fixed it!
from react.
Just in case my PR doesn't go through, I wrote a small blog post about how I'm implementing this for now without needing to use the vite plugin: https://adamtaylor.me/posts/fixing-a-minor-inconvenience-with-phosphor-icons/
from react.
Related Issues (20)
- Add `@preview` tag to enable icon previews in jsdoc HOT 4
- Could not find a declaration file when using SSR HOT 2
- SSR Components missing default size="1em"
- SSR component types are not resolving
- allow to add Contributing.md file.
- Importing icons from `@phosphor-icons/react/dist/ssr` renders the icons, but gives issues in the editor HOT 5
- TypeError: Cannot create property 'displayName' on number 'Infinity' HOT 7
- Unble to dynamic import icons .mjs extensions HOT 9
- Icon instance className overwrites context className HOT 8
- New Twitter (x.com) icon? HOT 1
- Cannot find package on node 20 HOT 6
- ./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) HOT 10
- UnhandledRejection Error: Cannot Find React Package HOT 23
- 'use client' in client icons and IconContext HOT 2
- React warning after update to 2.1.4 HOT 1
- Issue updating past 2.1.3 HOT 2
- Incorrect exports specified in `package.json` HOT 1
- Jest test fails if importing directly from `/dist` folder
- Custom icons: Typescript and ESLint errors in Next.js 14 HOT 1
- React web pack build error in phosphor icons HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.