Closed odub closed 6 years ago
The error entered here: https://github.com/justinmc/react-audio-player/commit/75f815bcdbb510dbf801ef2bf5a7532a715bc37e
Hmm, do you have prop-types
installed in your application? I thought it should work without errors as a peer dependency but I could be wrong. A fresh create-react-app
with this project added seems to work for me.
Maybe I'm getting carried away with the peer dependencies though. Just to check another more stable project, I see that React Router does list it as a dependency like you suggest.
Let me know what you think. Also is a conflict now since I just merged another PR. I think if you just bump the version to 15.6.0
it should be fine.
Oh and I just noticed, I think you meant to put it in dependencies
and not devDependencies
, right? This would be the first dependencies
entry I guess.
Thanks for the contribution!
Oops, yes you're right that it should be in dependencies
. I'll rebase over the new changes and fix the placement slip.
With create-react-app
it'll work because prop-types
will be in the node_modules
dir from being present at another point in the dependency tree. In a project where it's not there by virtue of another dependency requiring it, you should be able to see the error.
I don't have prop-types
in my application because I'm using an older version of React.
Based on the information here, it seems also like the behaviour of peerDependencies
changed in version 3. In the more recent versions, it seems like peerDependencies
only act to express version compatiblity, rather than specifying that the dependency is required to be downloaded.
Ok, done! I also pushed up react
in the same way for consistency.
Ah sorry I forgot to follow up on this. I'll go ahead and merge and will release a new version with this soon.
Thanks
Just got the following error from webpack, trying to build
react-audio-player
into a project:This should fix it –
prop-types
needs to be listed independencies
as well as inpeerDependencies
.