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

[Bug Report] release 1.0.1 Sass Loader does not match the API schema #119

Closed
PierreBrisorgueil opened this issue Oct 10, 2019 · 24 comments
Closed

Comments

@PierreBrisorgueil
Copy link

PierreBrisorgueil commented Oct 10, 2019

hello, since last release & vue cli 4

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? }
    at validate (/Users/pierrebrisorgueil/Documents/Dev/github/rype/Vue/node_modules/sass-loader/node_modules/schema-utils/dist/validate.js:49:11)
    at Object.loader (/Users/pierrebrisorgueil/Documents/Dev/github/rype/Vue/node_modules/sass-loader/dist/index.js:36:28)

 @ ./node_modules/vuetify/src/components/VSpeedDial/VSpeedDial.sass 4:14-209 14:3-18:5 15:22-217
 @ ./node_modules/vuetify/lib/components/VSpeedDial/VSpeedDial.js
 @ ./node_modules/vuetify/lib/components/VSpeedDial/index.js
 @ ./node_modules/vuetify/lib/components/index.js
 @ ./node_modules/vuetify/lib/index.js
 @ ./src/lib/plugins/vuetify.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

I would take a look as soon as I have a little time, if I can help do not hesitate.

how to reproduce :

  • clone the repo
  • npm i
  • npm start, everything would be ok
  • switch "vue-cli-plugin-vuetify": "^1.0.0" => "vue-cli-plugin-vuetify": "^1.0.1"
  • npm i
  • npm start, error should appear
@PierreBrisorgueil PierreBrisorgueil changed the title release 1.0.1 : Sass Loader has been initialised using an options object that does not match the API schema [Bug Report] release 1.0.1 Sass Loader has been initialised using an options object that does not match the API schema Oct 10, 2019
@PierreBrisorgueil PierreBrisorgueil changed the title [Bug Report] release 1.0.1 Sass Loader has been initialised using an options object that does not match the API schema [Bug Report] release 1.0.1 Sass Loader does not match the API schema Oct 10, 2019
@andreasRu
Copy link

there have been reports of vue-cli 4 not working with sass-loader version 8.0.0. do you have it installed in your project? Try downgrading to sass-loader@7.3.1 should work.

@PierreBrisorgueil
Copy link
Author

PierreBrisorgueil commented Oct 10, 2019

there have been reports of vue-cli 4 not working with sass-loader version 8.0.0. do you have it installed in your project? Try downgrading to sass-loader@7.3.1 should work.

Hello,

fixed since rc.3, I'm in rc.7. Everything was ok with rc.7 and sass-loader 8.0.0 before release 1.0.1

I evoked the issue just above :)

@ztoben
Copy link

ztoben commented Oct 10, 2019

I can replicate on my setup as well. This does not seem to be a vue-cli or sass-loader issue. Running vue-cli@rc.7 and sass-loader@8.0.0 works with this plugin on v1.0.0, but not v1.0.1

@willemavjc
Copy link

I can confirm this too.

Here is the complain from vue-cli-plugin-vuetify using version 1.0.1 by default at that time:

/usr/src/app/one # vue add vuetify

�📦  Installing vue-cli-plugin-vuetify.

+ vue-cli-plugin-vuetify@1.0.1
updated 1 package and audited 24929 packages in 44.69s
found 0 vulnerabilities

✔  Successfully installed plugin: vue-cli-plugin-vuetify

? Choose a preset: Default (recommended)
 WARN  conflicting versions for project dependency "sass-loader":

- ^8.0.0 injected by generator "undefined"
- ^7.1.0 injected by generator "vue-cli-plugin-vuetify"

Using newer version (^8.0.0), but this may cause build errors.

�🚀  Invoking generator for vue-cli-plugin-vuetify...
�📦  Installing additional dependencies.

added 3 packages from 2 contributors and audited 27084 packages in 69.802s
found 0 vulnerabilities

⠋  Running completion hooks...
> one@0.1.0 lint /usr/src/app/one
> vue-cli-service lint

The following files have been auto-fixed:

  src/App.vue
  src/components/HelloWorld.vue
  src/main.js
  src/plugins/vuetify.js
  src/views/Home.vue
  vue.config.js

 DONE  All lint errors auto-fixed.
⚓  Running completion hooks...

✔  Successfully invoked generator for plugin: vue-cli-plugin-vuetify
/usr/src/app/one # 

@DRoet
Copy link
Contributor

DRoet commented Oct 11, 2019

@johnleider

both @vue/cli ^3.12.0 and ^4.0.0-rc7 work with sass-loader: 8.0.0, however the cli-plugin doesn't seem to support it (yet).

might be caused by:
https://github.com/vuetifyjs/vue-cli-plugin-vuetify/blob/master/util/helpers.js#L49

that should probably be changed to opts.prependData

@bromix
Copy link

bromix commented Oct 14, 2019

same here :( sticking with sass-loader v7.3.1 for long as this works all together.

@willemavjc
Copy link

willemavjc commented Oct 14, 2019

@bromix @claudio10 For my personal knowledge, how do you achieve that? I mean, how do you get that particular version 7.3.1 of sass-loader rather than the 8.0.0?

yarn add @vue/cli@3.12.0
vue create .
vue add vuetify@1.0.0 #This still complains of sass-loader

Do you do some manual import and then package.json editing?

@karimdaghari
Copy link

@willemavjc here’s what you need to do:
(I’m assuming you’re doing a fresh install)

  1. Go to the package.json file
// package.json
// ...
// Change this:
“sass-loader”: "^8.0.0"
// To this:
“sass-loader”: "^7.3.1"
  1. vue add vuetify

@andreasRu
Copy link

andreasRu commented Oct 14, 2019

Just to complete information posted by @kdaghari for NPM: with NPM you simply do an installation adding a at-sign, just like:

npm -i -D sass-loader@7.3.1

@bromix
Copy link

bromix commented Oct 15, 2019

@bromix @claudio10 For my personal knowledge, how do you achieve that? I mean, how do you get that particular version 7.3.1 of sass-loader rather than the 8.0.0?

yarn add @vue/cli@3.12.0
vue create .
vue add vuetify@1.0.0 #This still complains of sass-loader

Do you do some manual import and then package.json editing?

Just remove the "^" and set the version fix in the package. Same like pip (requirements in python)

"sass-loader": "7.3.1",

For updating dependencies I only use "ncu" because npm won't update major updates.

@DRoet
Copy link
Contributor

DRoet commented Oct 17, 2019

Please try the latest release 1.0.2

@bromix
Copy link

bromix commented Oct 17, 2019

Please try the latest release 1.0.2

It's working :D Thanks.

@d3radicated
Copy link

Confirmed working on 1.0.2. Issue can be closed.

@PierreBrisorgueil
Copy link
Author

Perfect, thx a lot :) !

@willemavjc
Copy link

Not working with 1.0.2 on my end.

Some file seems to be now missing:

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: File to import not found or unreadable: ~vuetify/src/styles/styles.sass.
        on line 1 of /home/node/app/src/components/HelloWorld.vue
>> @import '~vuetify/src/styles/styles.sass';

Scenario tested implies Docker and is as such:

docker image pull node:12.11.1-alpine
docker container run -d -p 8081:8080 [...] -it node:12.11.1-alpine sh
cd ~
yarn add @vue/cli@3.12.0
ln -s ~/node_modules/@vue/cli/bin/vue.js ~/.yarn/bin/vue
export PATH=${PATH}:~/.yarn/bin
cd ~/app
vue  create .
vue  add vuetify@1.0.2
yarn serve

@DRoet
Copy link
Contributor

DRoet commented Oct 17, 2019

this is a different bug, if you specify the version number in vue add, the plugin is not being invoked.

docker image pull node:12.11.1-alpine
docker container run -d -p 8081:8080 [...] -it node:12.11.1-alpine sh
cd ~
yarn add @vue/cli@3.12.0
ln -s ~/node_modules/@vue/cli/bin/vue.js ~/.yarn/bin/vue
export PATH=${PATH}:~/.yarn/bin
cd ~/app
vue create .
vue add vuetify@1.0.2
yarn serve

make sure you do:

vue  create .
vue  add vuetify@1.0.2
vue  invoke vuetify
yarn serve

@willemavjc
Copy link

@DRoet Thanks. Confirmed working with vue/cli@3.12.0 ...and not working with @4.0.3, with the same error you mentioned in the new issue #4700 on Vue.js GitHub.

@willemavjc
Copy link

willemavjc commented Oct 17, 2019

Would someone be able to clarify if the following warning is a real issue?

Plugin vue-cli-plugin-vuetify@1.0.2 does not have a generator to invoke
Choose a preset: Default (recommended)
WARN  conflicting versions for project dependency "sass-loader":

- ^8.0.0 injected by generator "undefined"
- ^7.1.0 injected by generator "vue-cli-plugin-vuetify"

Using newer version (^8.0.0), but this may cause build errors.

In package.json I can see this:

    "node-sass": "^4.12.0",
...
    "sass": "^1.17.4",
    "sass-loader": "^8.0.0",

I don't really understand what is happening and what it does really imply.

@DRoet
Copy link
Contributor

DRoet commented Oct 17, 2019

It shouldn't be an issue if your package.json has 8.0.0, warning will be fixed by #123.
Also you shouldn't both use node-sass and sass, just using sass is enough

@willemavjc
Copy link

Also you shouldn't both use node-sass and sass, just using sass is enough

Coming back to this interesting remark:
Does it mean I should not select CSS pre-processors when building a new project via Vue CLI? (I never changed anything in the package.json so I assume Vue CLI and Vuetify did it.)

@DRoet
Copy link
Contributor

DRoet commented Oct 23, 2019

you should select is, but there are two options in the cli dart-sass or node-sass. you should always pick dart-sass for vuetify. dart-sass === sass

@CumpsD
Copy link

CumpsD commented Jul 6, 2020

sass-loader 9.0.0 broke it again btw

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

@DRoet
Copy link
Contributor

DRoet commented Jul 6, 2020

@CumpsD #185

@CumpsD
Copy link

CumpsD commented Jul 6, 2020

@CumpsD #185

Thanks!

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

9 participants