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 #924

Closed
affinage-digital opened this issue Feb 6, 2021 · 3 comments
Closed

this.getOptions is not a function #924

affinage-digital opened this issue Feb 6, 2021 · 3 comments

Comments

@affinage-digital
Copy link

affinage-digital commented Feb 6, 2021

  • Operating System: Windows 10
  • Node Version: v12.18.1
  • NPM Version: 6.14.8
  • webpack Version: 4.46.0 (nuxt.js 2.14.12)
  • sass-loader Version: 11.0.0

Expected Behavior

Compile without errors

Actual Behavior

Failed to compile with 1 errors

Code

ERROR  in ./layouts/error.vue?vue&type=style&index=0&lang=scss&                                                                                                        friendly-errors 19:28:06  

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):                                                                                                      friendly-errors 19:28:06  
TypeError: this.getOptions is not a function
    at Object.loader (C:\******\node_modules\sass-loader\dist\index.js:25:24)
                                                                                                                                                                        friendly-errors 19:28:06
 @ ./node_modules/vue-style-loader??ref--7-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--7-oneOf-1-3!./node_modules/sass-resources-loader/lib/loader.js??ref--7-oneOf-1-4!./node_modules/vue-loader/lib??vue-loader-options!./layouts/error.vue?vue&type=style&index=0&lang=scss& 4:14-437 14:3-18:5 15:22-445
 @ ./layouts/error.vue?vue&type=style&index=0&lang=scss&
 @ ./layouts/error.vue
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi eventsource-polyfill webpack-hot-middleware/client?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js

How Do We Reproduce?

In nuxt project with @nuxtjs/style-resources and scss files
npm run dev

Potential solution

npm install sass-loader@10.1.1

@alexander-akait
Copy link
Member

You need webpack v5 to use the latest verison, please read CHANGELOG before updating

@affinage-digital
Copy link
Author

You need webpack v5 to use the latest verison, please read CHANGELOG before updating

Thank you!
In my case it's easier to install an older version of sass-loader
nuxt/nuxt#8252 (comment)

gildesmarais added a commit to svenpanel/the-shrine-ng that referenced this issue Aug 5, 2021
and use sass-loader version <11 due to nuxt 2 not supporting webpacker 5

related: webpack-contrib/sass-loader#924
gildesmarais added a commit to svenpanel/the-shrine-ng that referenced this issue Aug 5, 2021
and use sass-loader version <11 due to nuxt 2 not supporting webpacker 5

related: webpack-contrib/sass-loader#924
@StasNemy
Copy link

StasNemy commented Feb 3, 2022

You can use this v10.1.1 with webpack v4*

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

3 participants