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

react-router@4.4.0-beta.4 is missing dependency prop-types #6438

Closed
mgroenhoff opened this issue Oct 30, 2018 · 7 comments
Closed

react-router@4.4.0-beta.4 is missing dependency prop-types #6438

mgroenhoff opened this issue Oct 30, 2018 · 7 comments
Labels

Comments

@mgroenhoff
Copy link

react-router@4.4.0-beta.4 is missing dependency prop-types

@timdorr
Copy link
Member

timdorr commented Oct 30, 2018

Looks like it got removed in bff4af5.

@mgroenhoff
Copy link
Author

@mjackson
Copy link
Member

I think it was removed in 6615b9e when @TrySound moved everything in node_modules (our deps) out of our bundles. We still need it in our builds, but it should be tree-shaken out of production builds because all our usage of PropTypes is behind the __DEV__ flag. I will double check.

@mgroenhoff I'm curious, which build are you using?

@mjackson mjackson added the bug label Oct 31, 2018
@TrySound
Copy link
Contributor

Well imports cannot be treeshaken. So prop-types package should always be in deps if you use it.

@mgroenhoff
Copy link
Author

mgroenhoff commented Nov 1, 2018

@mjackson I am building a bundle using Webpack and it imports esm/react-router.js (it follows the module property from package.json) which has the import statement in the top of the file. Webpack fails to find this module so it errors.

@timdorr
Copy link
Member

timdorr commented Nov 1, 2018

Yep, Rollup can tree shake/DCE the initial import statement, but Webpack cannot. That would happen with terser/ugilfy/babel-minify as a DCE step.

@mjackson
Copy link
Member

mjackson commented Nov 1, 2018

Just published the fix in 4.4.0-beta.6

@lock lock bot locked as resolved and limited conversation to collaborators Dec 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants