Closed bbialas closed 3 years ago
I get the same error with "@nuxtjs/vuetify": "1.11.2" and "nuxt": "2.15.6"
If you use Yarn you can put
"resolutions": {
"@nuxtjs/vuetify/**/sass": "1.32.12"
},
in your package.json and it should work.
Same Error with "@nuxtjs/vuetify": "1.11.3" and "nuxt": "2.15.6"
i got same error here how to fix it?
i use nuxt: 2.15.3
@nuxtjs/vuetify: 1.11.3
and nuxt typescript.
when i use treeShake: true
it's get the error like @bbialas said.
but if i not use treeShake
it's working & not get the error
The temporary solution proposed by @Heniker works perfectly, thank you.
package.json
"resolutions": {
"@nuxtjs/vuetify/**/sass": "1.32.12"
}
For regular NPM users there is another solution available (as a temporary fix).
npm-force-resolutions
. "preinstall": "npx npm-force-resolutions"
to your npm scripts.package.json
: "resolutions": {
"sass": "1.32.12"
}
@erikeuserr In order this to work for me with Nuxt + Vuetify + npm I had to use
"resolutions": {
"@nuxtjs/vuetify/**/sass": "1.32.12"
}
instead of what you suggest
"resolutions": {
"sass": "1.32.12"
}
But it works. Thank you!
If you use Yarn you can put
"resolutions": { "@nuxtjs/vuetify/**/sass": "1.32.12" },
in your package.json and it should work.
This doesn't seem to work in my monorepo project, unfortunately.
I have the same error. is there a solution to this problem?
i use nuxt: 2.15.6
&& @nuxtjs/vuetify: 1.11.3
this my step to handle this error for now
in your package.json
add
"preinstall": "npx npm-force-resolutions"
inside the scripts section
add
"resolutions": {
"sass": "1.32.12"
},
below your scripts section
after that run command npm i
after finish run again your project and voila the error was gone
if you dont understand my step this my package.json
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"preinstall": "npx npm-force-resolutions" // preinstall goes here
},
"resolutions": { // resolutions goes here
"sass": "1.32.12"
},
"dependencies": {
// some dependencies
}
after that run command npm i
or npm install
after finish run again your project
Same problem with monorepo
Temporary solution for NPM users:
npm i sass@1.32.8
No need to change anything but if you still face issue then treeShake: false
Temporary solution for NPM users:
npm i sass@1.32.8
No need to change anything but if you still face issue then
treeShake: false
This worked for me.
@clarkdo @Atinux @pi0
Please fix this issue or provide a permanent solution :)
I'd tried to force Vuetify version 2.5.2
which address this issue, adding to my package.json
"devDependencies": {
...
"vuetify": "2.5.2",
"sass": "1.34.0",
"sass-loader": "10.2.0"
}
No luck. It outputs multiple SassError: @use rules must be written before any other rules.
ERROR in ./node_modules/vuetify/src/components/VBanner/VBanner.sass
Module build failed (from ./node_modules/extract-css-chunks-webpack-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: @use rules must be written before any other rules.
╷
4 │ @use 'sass:math'
│ ^^^^^^^^^^^^^^^^
╵
node_modules/vuetify/src/components/VBanner/VBanner.sass 4:1 root stylesheet
But the actual file contains nothing before @use 'sass:math'
1| // Imports
2| @use 'sass:math'
I assume that maybe there is some loader prepending something before the file content.
Using this solves the error but keeps the division warnings
{
...
"vuetify": "2.4.2",
"sass": "1.32.8"
}
this worked for me:
"devDependencies": {
"@nuxtjs/vuetify": "^1.11.3",
"sass": "~1.32.13",
"sass-loader": "^10.1.1"
}
Module version 1.11.3
Describe the bug After installing latest version of this module, it downloaded as dependency latest version of SASS which is 1.33.0. In this sass version, they introduced braking change and deprecated
/
as divider symbol in favour ofmath.div()
.Now during build, it throws errors like:
To Reproduce Just install latest version of this module.
Expected behavior Long term solution would be to replace
/
withmath.div()
in the whore repo. Quick fix could be to change package.json and lock sass dependency to version 1.32.12