[Snyk] Security upgrade webpack-dev-server from 3.2.1 to 4.7.3#61
[Snyk] Security upgrade webpack-dev-server from 3.2.1 to 4.7.3#61saurabharch wants to merge 1 commit into
Conversation
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-NODEFORGE-14114940 - https://snyk.io/vuln/SNYK-JS-NODEFORGE-14125745 - https://snyk.io/vuln/SNYK-JS-NODEFORGE-14125097
Summary of ChangesHello @saurabharch, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the project's security by updating the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request, automatically generated by Snyk, upgrades webpack-dev-server from version 3.2.1 to 4.7.3 to fix several security vulnerabilities. While the security upgrade is important, this is a major version bump that introduces significant breaking changes. As it stands, the PR will break the development environment because it does not account for the new API and configuration requirements of webpack-dev-server v4, nor does it upgrade the webpack dependency which is now incompatible. My review includes a critical comment detailing the necessary changes to make this upgrade work.
| "url-loader": "1.1.2", | ||
| "webpack": "4.29.6", | ||
| "webpack-dev-server": "3.2.1", | ||
| "webpack-dev-server": "4.7.3", |
There was a problem hiding this comment.
Upgrading webpack-dev-server from v3 to v4 is a major change that introduces several breaking changes. Merging this PR as-is will break the development server because it requires code and configuration updates that are not included here.
Here are the critical issues that need to be addressed:
-
webpackDependency:webpack-dev-serverv4 requireswebpackversion4.37.0or newer. This project uses version4.29.6, which is incompatible. You'll need to upgrade thewebpackdependency in this file. -
WebpackDevServerAPI Change: The constructor signature has changed. Inscripts/start.js(line 107), the callnew WebpackDevServer(compiler, serverConfig)needs to be changed tonew WebpackDevServer(serverConfig, compiler). -
Configuration Changes: The configuration file
config/webpackDevServer.config.jsuses several options that have been removed or renamed in v4. These will cause the server to fail to start. Here's a list of required changes based on your current configuration:disableHostCheck: Removed. UseallowedHosts.clientLogLevel: Removed. Useclient: { logging: 'none' }.contentBase: Removed. Usestatic: { directory: ... }.watchContentBase: Removed. Usestatic: { watch: true }.publicPath: Moved todevMiddleware: { publicPath: '/' }.quiet: Removed. Useclient: { logging: 'none' }or similar.watchOptions: Removed. UsewatchFiles.overlay: Moved toclient: { overlay: false }.public: Removed. UseallowedHosts.before(): Removed. UseonBeforeSetupMiddleware().
Given the extent of these breaking changes, I recommend either expanding this PR to include all the necessary fixes or creating a new manual PR to handle the upgrade comprehensively.
Snyk has created this PR to fix 3 vulnerabilities in the npm dependencies of this project.
Snyk changed the following file(s):
package.jsonVulnerabilities that will be fixed with an upgrade:
SNYK-JS-NODEFORGE-14114940
SNYK-JS-NODEFORGE-14125745
SNYK-JS-NODEFORGE-14125097
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.