tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.45k stars 1.28k forks source link

Import warning in Remix App #717

Closed JeffBeltran closed 2 years ago

JeffBeltran commented 2 years ago

This is low priority as it doesn't seem to impact anything other than my OCD but wanted to report this as i get the following message when using this package in my remix project.

Note I tested this with MUI Icons too to see if there might be a connection, but I didn't get a warning like i do for this package, so figured i would report this here.

Building Remix app in production mode...
The path "@heroicons/react/outline" is imported in app/routes/index.tsx but @heroicons/react is not listed in your package.json dependencies. Did you forget to install it?
Built in 205ms

This will happen for both outline and solid icons, just depends on which import is listed first.

Here is a reproduction of the issue: https://github.com/JeffBeltran/heroicons-import-error

but you can do this yourself as well

  1. Create Remix Project: npx create-remix@latest
  2. install Heroicons: npm install @heroicons/react
  3. Add any icon to a page
  4. see error in terminal when running either npm run dev or npm run build
adamwathan commented 2 years ago

Weird one! Feels more like a Remix issue than a Heroicons issue though? Not sure what we could actually do here.

JeffBeltran commented 2 years ago

I was just searching their discord and found this: https://github.com/remix-run/remix/issues/3604.

Initially i wasn't sure where to start but since this was the only package that was giving me this message I thought it might not be related to remix. Looks like they have a possible PR open for the fix too. If this pops up again i'll post here.

Thanks