Search code examples
ruby-on-rails-6webpacker

Webpacker fails compilation after I add sass loader npm package


I really have no idea why I am getting the following:

   ERROR in ./app/javascript/packs/application.scss (./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/postcss-loader/src??ref--6-2!./node_modules/sass-loader/dist/cjs.js??ref--6-3!./app/javascript/packs/application.scss)
    Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
    TypeError: this.getOptions is not a function

when I include sass-loader to package.json with

yarn add sass-loader

If i remove it with yarn remove sass-loader, webpacker compiles everything with no error

Thank you


Solution

  • Try to install an earlier version. In my case i installed version 10.1.1

    [email protected]
    

    and I was able to advance to the next problem... ;-)