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

Update desired webpack version in peerDeps #4494

Closed
wants to merge 2 commits into from

Conversation

kylemh
Copy link

@kylemh kylemh commented Feb 3, 2022

Was receiving errors about missing peerDependencies when installing. Saw #3868 and figured Webpack 5 works just fine!

@kylemh
Copy link
Author

kylemh commented Feb 8, 2022

Actually, maybe this isn't so simple 🤔

@kamilogorek Next.js bundles webpack. Should I install webpack deps anyways? If not, I'm guessing we can just remove the peerDeps field.

@kamilogorek
Copy link
Contributor

Yes, we still do need webpack to be installed, as the change you linked is only 4mo old, where we need to support previous versions as well.

@kylemh
Copy link
Author

kylemh commented Feb 11, 2022

I guess I'm confused. Isn't webpack already bundled into Next.js?

@kamilogorek
Copy link
Contributor

Yes, but only since 4 months ago. It wasn't previously.

@kylemh
Copy link
Author

kylemh commented Feb 14, 2022

Understood. So then this is just tricky to represent correctly with the dependency fields in package.json. It's optional, but only conditionally for users of Next.js >=11.(whatever that minor was).

All this being said, is the change in this PR not desired? It seems like things should still work out fine. You're requiring some correct version of Webpack here - and one that won't conflict with source code nor consumer's dependency mgmt.

@kamilogorek
Copy link
Contributor

Is the change in this PR not desired? It seems like things should still work out fine. You're requiring some correct version of Webpack here - and one that won't conflict with source code nor consumer's dependency mgmt.

The thing is that this change does basically nothing 😅 Our minimum required version for types is 4.41.31, doesn't matter whether it's newer or not. And for webpack version, >= 4.0.0 already covers both 4.x and 5.x that you changed it to.

@kylemh
Copy link
Author

kylemh commented Feb 15, 2022

It does something important actually. For npm, doing this could potentially allow for not installing another version of Webpack (if using Webpack 5). It also stops peerDependency warnings from showing up when installing dependencies with yarn or pnpm.

edit: I see you pointed out >= should cover the version, but it doesn't seem to. I still get warnings.

@kamilogorek
Copy link
Contributor

cc @lobsterkatie @AbhiPrasad

@AbhiPrasad
Copy link
Member

Possibly addressed by #4634?

@kylemh
Copy link
Author

kylemh commented Feb 25, 2022

Possibly. I worry that npm may ignore that field (peerDependenciesMeta), like they do so many others.

@AbhiPrasad
Copy link
Member

@belgattitude goes into some detail about support here getsentry/sentry-webpack-plugin#354 (comment)

I think we are going to give this a try, and if it still causes issues we can come back and re-evaluate. Release should be out early next week with the peerDependenciesMeta changes.

Sorry for the back and forth and long delays @kylemh, appreciate the help!

@kylemh
Copy link
Author

kylemh commented Feb 25, 2022

All y'all responded super quickly! I'll close this one then.

@kylemh kylemh closed this Feb 25, 2022
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

Successfully merging this pull request may close these issues.

3 participants