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

Importing icons from @phosphor-icons/react/dist/ssr renders the icons, but gives issues in the editor #78

Open
nikita-bashaiev opened this issue Nov 3, 2023 · 5 comments

Comments

@nikita-bashaiev
Copy link

This is the issue description I get from typing:
import { Fish } from '@phosphor-icons/react/dist/ssr';

Could not find a declaration file for module '@phosphor-icons/react/dist/ssr'. 'C:/Work/Projekty/Dezarto/dezarto-next/node_modules/.pnpm/@phosphor-icons[email protected][email protected][email protected]/node_modules/@phosphor-icons/react/dist/ssr/index.mjs' implicitly has an 'any' type.
There are types at 'c:/Work/Projekty/Dezarto/dezarto-next/node_modules/@phosphor-icons/react/dist/ssr/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@phosphor-icons/react' library may need to update its package.json or typings.ts(7016)

Despite that, the icon renders correctly in dev. It does, however, disable autocomplete suggestions in the editor, which makes working with icons harder.

@josepholiveira
Copy link

I noticed this happens when using "moduleResolution": "bundler" on tsconfig, changing away from it solves the problem, but doesn't sound good to change it.

New projects with Vite or even Next now start up with that setting by default.

@rektdeckard
Copy link
Member

I have found reports that VSCode isn't 100% ready for "moduleResolution": "bundler". This may be the cause, as I see no fundamental issue with our typings, or with our exports declaration in package.json. If you have any suggestions, I'm happy to hear them.

@atralice
Copy link

Im getting the same warning in VSCode. Everything works fine tho.

Did you guys find a way to fix this?

@LeonardoMeireles55
Copy link

same problem here.

@rektdeckard
Copy link
Member

Can anyone please share a minimal reproduction of this in a Stickblitz or repo?

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

5 participants