[v6.0.0] TypeError: this.getOptions is not a function
See original GitHub issue🐛 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:
To Reproduce
Steps to reproduce the behavior:
- Compile any React 17 web project
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 :
removed getOptions in favor loaderContext.getOptions (loaderContext is this inside loader function),
note - special query parameters like ?something=true is not supported anymore,
if you need this please do it on loader side, but we strongly recommend avoid it, as alternative you can use ?something=1 and handle 1 as true
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:18 (6 by maintainers)
Top Results From Across the Web
TypeError: this.getOptions is not a function - vue.js
1. I am using @vue/cli 4.5.8 that includes webpack@4.46.0. From v11.0.0 of sass-loader and v8.
Read more >[Solved]-TypeError: this.getOptions is not a function-Vue.js
I am using @vue/cli 4.5.8 that includes webpack@4.46.0. From v11.0.0 of sass-loader and v8.0.0 of less-loader, the.
Read more >TypeError: this.getOptions is not a function 的解决(vue,react)
1.npm uninstall less-loader2.npm install less-loader@5.0.0一、报错信息TypeError: this.getOptions is not a function这个是在运行项目是遇到的 ...
Read more >Syntax Error: TypeError: this.getOptions is not a function
ERROR Failed to compile with 1 error 上午11:51:16. error in .
Read more >storybook使用sass报错TypeError:this.getOptions is no - 墨陌默
TypeError: this.getOptions is not a function at Object.loader (/Users/oyt/Downloads/story/node_modules/style-loader/dist/index.js:19:24)
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have exact same problem. Going back to 5.5.0 fixed it for now.
I had the same issue here while trying to use svgr with
@storybook/react@^6.4.9
. The storybook’s docs said it fully upgraded to webpack@5 , but I still see webpack@4 references in my .lock file