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

this.getOptions is not a function #932

Closed
wut1 opened this issue Mar 2, 2021 · 11 comments
Closed

this.getOptions is not a function #932

wut1 opened this issue Mar 2, 2021 · 11 comments

Comments

@wut1
Copy link

wut1 commented Mar 2, 2021

  • sass-loader Version:11.0.1

Actual Behavior

Syntax Error: TypeError: this.getOptions is not a function

Code

code

@alexander-akait
Copy link
Member

You need webpack v5 to use latest version

@mdodge-ecgrow
Copy link

I'm getting this issue as well in my React app. I don't have webpack, but I have webpack-cli upgraded to the latest, 4.6.0.

@alexander-akait
Copy link
Member

Run npm ls webpack

@mdodge-ecgrow
Copy link

Here is a snippet of what I see from that command:

| +-- optimize-css-assets-webpack-plugin@5.0.4
| | `-- webpack@4.44.2 deduped
| +-- sass-loader@10.1.1
| | `-- webpack@4.44.2 deduped
| +-- style-loader@1.3.0
| | `-- webpack@4.44.2 deduped
| +-- terser-webpack-plugin@4.2.3
| | `-- webpack@4.44.2 deduped

@alexander-akait
Copy link
Member

with webpack v4 you should not get this error, do you have webpack globally?

@mdodge-ecgrow
Copy link

No I do not have it installed globally, should I?

@alexander-akait
Copy link
Member

No, if you got this error, it means you still on webpack v4

@mdodge-ecgrow
Copy link

But i don't have webpack at all in my package.json, just webpack-cli. What do I need to do?

@alexander-akait
Copy link
Member

Please provide package.json content

@DonikaV
Copy link

DonikaV commented Apr 27, 2021

I have webpack 4* and i get same error

vendors~init_react_context~server_rendering-78c329f7ea8b64b78f91.chunk.js:47270 Error: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: this.getOptions is not a function
    at Object.loader (Users/valeriidonika/Work/GitHub/App/node_modules/postcss-loader/dist/index.js:38)
    at Object../node_modules/css-modules-typescript-loader/index.js!./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/dist/cjs.js?!.

"sass-loader": "11.0.1",
"node-sass": "4.14.1",
"sass": "^1.32.11",

@alexander-akait
Copy link
Member

You need webpack v5 to use the latest version of loader

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

4 participants