Closed cometkim closed 1 year ago
Temporary fix:
import { icon } from '@heroicons/react/24/outline/esm/index.js'
Hey! Can you provide a minimal reproduction for this as a Git repo?
This should work, as we do ship an ESM version, which you can see in the package.json file:
https://unpkg.com/browse/@heroicons/react@2.0.13/24/solid/package.json
You can also see the ESM versions of the icons here:
https://unpkg.com/browse/@heroicons/react@2.0.13/24/solid/esm/
So I suspect this probably has something to do with your particular project setup, which is why the minimal reproduction is important 👍
Thanks!
Hey! I've merged a change in #920 that should enable this to work. Bare ESM requires the use of extensions unless a package provides an exports field with what amounts to an import map. It will be available in our next tagged release (possibly today but if not it will happen this week).
cannot use in SSR + ESM environment