-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
[v6.0.0] TypeError: this.getOptions is not a function #631
[v6.0.0] TypeError: this.getOptions is not a function #631
Comments
Hey @korbav 👋, |
I have exact same problem. Going back to 5.5.0 fixed it for now. |
Hello, the new loader is only compatible with webpack 5, please upgrade or stay in v5.x. |
Hello @gregberge , Actually I'm already using Webpack 5 : |
Hello @korbav, it is weird, I let it opened, waiting for other feedback, feel free to investigate it further. |
Hi @gregberge , According to the fact we are explicitly using svgr/packages/webpack/package.json Line 43 in 66c1eae
We should not refactor anything based on the breaking changes introduced by `## 3.0.0 (2021-10-20) ⚠ BREAKING CHANGES
We are explicitly following the previous instruction (which should be implemented only on ^3.0.0) : svgr/packages/webpack/src/index.ts Lines 58 to 65 in 66c1eae
So my guess would be to step back and to use the previous way of getting the options :
|
Since |
If |
@korbav very weird, because actually tests are passing in the project |
@korbav what is your setup? |
I'm using Investigating it a bit more, it seems that Would it be possible that somehow the test version feeds whatever it needs to compile and prod version doesn't? Edit: Just checked with the v6.1.0, still the same issue |
Hello @gregberge , I finally understood what was going on. |
Good to hear, thanks! |
I had the same issue here while trying to use svgr with |
same issue. I also use @storybook/react@^6.4.9 |
This is not surprising, they have an explicit dependency to webpack 4 in the I would advise either not to upgrade svgr for the moment, or to create an issue/discussion on storybook to figure out what they plan to upgrade to webpack 5. |
@korbav Thanks for your explanation👍 |
Can be solved by forcing storybook to use webpack 5: |
gregberge/svgr#631 を解決するためにはwebpack5にあげれば良いとのこと
using the latest version introduces this [issue](gregberge/svgr#631)
Hey, I just new a question on Stackoverfolow. |
🐛 Bug Report
Last release v6.0.0 provoked the following issue :
TypeError: this.getOptions is not a function
Which is referring to the following call:
svgr/packages/webpack/src/index.ts
Lines 58 to 71 in 81369db
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The compilation process fails and throws an exception :
Failed to compile. TypeError: this.getOptions is not a function
This unexpected behavior appeared right after upgrading to v6.0.0, it is most likely related to an incompatibility issue with the 3.0.0+ version of
loader-utils
which brought the following breaking change :The text was updated successfully, but these errors were encountered: