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

svgr/webpack@6 is incompatible with webpack@4 due to usage of this.getOptions webpack method #665

Closed
Jar-L opened this issue Jan 18, 2022 · 5 comments

Comments

@Jar-L
Copy link

Jar-L commented Jan 18, 2022

The subject

svgr/webpack@6 is incompatible with webpack@4 due to usage of this.getOptions added in webpack@5

Last working version

Worked up to version: svgr/webpack@5

Stopped working in version: svgr/webpack@6

To Reproduce

Try to run @svgr/webpack@6 with webpack@4.

Expected behavior

@svgr/webpack loader usage should not to cause crash in build made with webpack@4.

Link to repl or repo

The example repo

Run npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard

## System:
 - OS: Linux 5.10 Manjaro Linux
 - CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1505M v6 @ 3.00GHz
 - Memory: 2.31 GB / 15.35 GB
 - Container: Yes
 - Shell: 5.1.12 - /bin/bash
## Binaries:
 - Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node
 - Yarn: 1.22.17 - ~/.nvm/versions/node/v14.18.2/bin/yarn
 - npm: 6.14.15 - ~/.nvm/versions/node/v14.18.2/bin/npm
## npmPackages:
 - @svgr/webpack: ^6.2.0 => 6.2.0
@gregberge
Copy link
Owner

@svgr/webpack loader usage should not to cause crash in build made with webpack@4.

In fact it should: https://react-svgr.com/docs/migrate/#webpack

We are moving forward, not backward. If you use webpack 4, then you should stick to SVGR v5.

@smckinney1
Copy link

smckinney1 commented Mar 22, 2022

@gregberge can this be listed in the breaking changes for v6? Totally understand not sticking to old standards, but it would have saved some time for me today to know ahead of time that we wouldn't be able to upgrade yet.

EDIT: Sorry, just saw the migration docs. Would have also been helpful to see this in the release notes for v6 in GitHub.

@gregberge
Copy link
Owner

@smckinney1 I mentioned the migration guide in the release note.

jonenst added a commit to gridsuite/commons-ui that referenced this issue Aug 29, 2022
babel/helper-builder-react-jsx held back because of babel/babel#14886,
can be upgraded once the fix is released

svgr needs to stay @v5: gregberge/svgr#665 (comment)
"We are moving forward, not backward. If you use webpack 4, then you should stick to SVGR v5."

eslint-loader -> eslint-webpack-plugin @ v2
from https://www.npmjs.com/package/eslint-loader "This loader has been deprecated. Please use eslint-webpack-plugin"
from https://webpack.js.org/plugins/eslint-webpack-plugin/ "This is eslint-webpack-plugin 3.0 which works only with webpack 5. For the webpack 4, see the 2.x branch."

TODO: still need to do
  "babel-eslint": "^10.1.0", -> "@babel/eslint-parser": "^7.0.0" + "@babel/eslint-plugin": "^7.0.0",
  eslint 7 -> 8
didn't work easily for me..
jonenst added a commit to gridsuite/commons-ui that referenced this issue Aug 29, 2022
babel/helper-builder-react-jsx held back because of babel/babel#14886,
can be upgraded once the fix is released

svgr needs to stay @v5: gregberge/svgr#665 (comment)
"We are moving forward, not backward. If you use webpack 4, then you should stick to SVGR v5."

eslint-loader -> eslint-webpack-plugin @ v2
from https://www.npmjs.com/package/eslint-loader "This loader has been deprecated. Please use eslint-webpack-plugin"
from https://webpack.js.org/plugins/eslint-webpack-plugin/ "This is eslint-webpack-plugin 3.0 which works only with webpack 5. For the webpack 4, see the 2.x branch."

TODO: still need to do
  "babel-eslint": "^10.1.0", -> "@babel/eslint-parser": "^7.0.0" + "@babel/eslint-plugin": "^7.0.0",
  eslint 7 -> 8
didn't work easily for me..
jonenst added a commit to gridsuite/commons-ui that referenced this issue Aug 29, 2022
babel/helper-builder-react-jsx held back because of babel/babel#14886,
can be upgraded once the fix is released

svgr needs to stay @v5: gregberge/svgr#665 (comment)
"We are moving forward, not backward. If you use webpack 4, then you should stick to SVGR v5."

eslint-loader -> eslint-webpack-plugin @ v2
from https://www.npmjs.com/package/eslint-loader "This loader has been deprecated. Please use eslint-webpack-plugin"
from https://webpack.js.org/plugins/eslint-webpack-plugin/ "This is eslint-webpack-plugin 3.0 which works only with webpack 5. For the webpack 4, see the 2.x branch."

TODO: still need to do
  "babel-eslint": "^10.1.0", -> "@babel/eslint-parser": "^7.0.0" + "@babel/eslint-plugin": "^7.0.0",
  eslint 7 -> 8
didn't work easily for me..
jonenst added a commit to gridsuite/commons-ui that referenced this issue Aug 29, 2022
babel/helper-builder-react-jsx held back because of babel/babel#14886,
can be upgraded once the fix is released

svgr needs to stay @v5: gregberge/svgr#665 (comment)
"We are moving forward, not backward. If you use webpack 4, then you should stick to SVGR v5."

eslint-loader -> eslint-webpack-plugin @ v2
from https://www.npmjs.com/package/eslint-loader "This loader has been deprecated. Please use eslint-webpack-plugin"
from https://webpack.js.org/plugins/eslint-webpack-plugin/ "This is eslint-webpack-plugin 3.0 which works only with webpack 5. For the webpack 4, see the 2.x branch."

TODO: still need to do
  "babel-eslint": "^10.1.0", -> "@babel/eslint-parser": "^7.0.0" + "@babel/eslint-plugin": "^7.0.0",
  eslint 7 -> 8
didn't work easily for me..
sBouzols pushed a commit to gridsuite/commons-ui that referenced this issue Aug 30, 2022
babel/helper-builder-react-jsx held back because of babel/babel#14886,
can be upgraded once the fix is released

svgr needs to stay @v5: gregberge/svgr#665 (comment)
"We are moving forward, not backward. If you use webpack 4, then you should stick to SVGR v5."

eslint-loader -> eslint-webpack-plugin @ v2
from https://www.npmjs.com/package/eslint-loader "This loader has been deprecated. Please use eslint-webpack-plugin"
from https://webpack.js.org/plugins/eslint-webpack-plugin/ "This is eslint-webpack-plugin 3.0 which works only with webpack 5. For the webpack 4, see the 2.x branch."

TODO: still need to do
  "babel-eslint": "^10.1.0", -> "@babel/eslint-parser": "^7.0.0" + "@babel/eslint-plugin": "^7.0.0",
  eslint 7 -> 8
didn't work easily for me..
@kyrofa
Copy link

kyrofa commented Dec 1, 2022

Just hit this myself.

@bertyhell
Copy link
Contributor

bertyhell commented Nov 16, 2023

I created a PR to add this to the changelog file. Since I hit this myself as wel today.
https://github.com/gregberge/svgr/pull/923/files

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

5 participants