lottie-react-web icon indicating copy to clipboard operation
lottie-react-web copied to clipboard

this package is not compatible with `type: module`

Open Aghassi opened this issue 2 years ago • 1 comments

If you have a package that sets type: module, and that package imports this package you can get into a weird error state where this package seems to return a bad object. In our case, our chain was Vite --> ESBuild --> Emotion --> This package. We suspect it is this package because components that didn't rely on this rendered just fine. Components that did rely on this hit an error boundary that had the following:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

I'm still debugging but this library seems to be the root cause/culprit.

As an aside, is this library still under active development @felippenardi? I'm concerned that this library is not compatible with the ever changing JS ecosystem going forward

Aghassi avatar Jul 19 '23 18:07 Aghassi

Ok well here is the root cause

https://github.com/vitejs/vite/issues/2139#issuecomment-824557740 https://github.com/rollup/plugins/issues/481 https://github.com/rollup/plugins/issues/654

I'd like to request that this package change the way it ships. If you can instead just ship transpile source code instead of prebundling this issue is basically avoided.

Aghassi avatar Jul 19 '23 20:07 Aghassi