vue-cli-plugin-scss-base icon indicating copy to clipboard operation
vue-cli-plugin-scss-base copied to clipboard

BUG: ValidationError: Invalid options object. Sass Loader has been initialised using an options object that does not match the API schema.

Open alexiej opened this issue 5 years ago • 6 comments

On this package list:

    "sass": "^1.19.0",
    "sass-loader": "^8.0.0",
    "storybook-addon-vue-info": "1.1.1",
    "storybook-vue-router": "1.0.3",
    "typescript": "~3.5.3",
    "vue-cli-plugin-atomic-design": "^0.3.3",
    "vue-cli-plugin-electron-builder": "^1.4.0",
    "vue-cli-plugin-pug": "^1.0.7",
    "vue-cli-plugin-scss-base": "0.2.2",
    "vue-template-compiler": "^2.6.10"

and this configuration

  css: {
    loaderOptions: {
      sass: {
        data: '@import "@/scss/settings.scss";'
      }
    }
  }

I've got error

 ERROR  Failed to compile with 2 errors                                                                                                                                                                        18:43:37

 error  in ./src/App.vue?vue&type=style&index=0&lang=scss&

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
ValidationError: Invalid options object. Sass Loader has been initialised using an options object that does not match the API schema.
 - options has an unknown property 'data'. These properties are valid:
   object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }

To fix this I have to change the configuration to:

  css: {
    loaderOptions: {
      sass: {
        prependData: '@import "@/scss/settings.scss";'
      }
    }
  }

alexiej avatar Nov 22 '19 17:11 alexiej

It work !

class90431 avatar May 30 '20 03:05 class90431

Nice,It work!

Junjie1314 avatar Oct 16 '20 06:10 Junjie1314

Thank You !

Kamil-Jasinski avatar Apr 14 '21 16:04 Kamil-Jasinski

Thanks !

soneryildirimx avatar May 13 '21 09:05 soneryildirimx

Tysm!! What a life saver!!

Jaxz102 avatar Jul 01 '21 18:07 Jaxz102

where do i find this config please css: { loaderOptions: { sass: { prependData: '@import "@/scss/settings.scss";' } } }

denisecbiker avatar Apr 05 '23 14:04 denisecbiker