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

"prop-types" is listed as devDependency but is always imported, resulting in runtime errors #62

Open
Yuval-Peled opened this issue Jun 4, 2023 · 0 comments

Comments

@Yuval-Peled
Copy link

This library's source code includes this line:

import PropTypes from "prop-types";

https://github.com/felippenardi/lottie-react-web/blob/bcebeaac478094776ca7396085ada4055ec95bad/src/index.js#LL2C32-L3C1

But "prop-types" is only listed as devDepenecy, which is not installed by default (we happen to use pnpm).

This causes a runtime error in the browser:
TypeError: Failed to resolve module specifier "prop-types". Relative references must start with either "/", "./", or "../".

The solution would be to either make the import conditional or to move propTypes to the production dependencies list (which will increase the size of this package even futher).

I'm happy to open a PR but this repository seems to be stale (3 years since last update). Will gladly submit a fix if the package maintainer says that it will be published. Otherwise, I'm opening this issue for posterity, in case other people encounter the same problem

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

1 participant