sass failed to compile
m4rcTr3y opened this issue ยท 13 comments
hey i installed the sass library into my project but still got this error. Any fixes on this
ERROR 17:41:35 [vite] Internal server error: Preprocessor dependency "sass" not found. Did you install it? 17:41:35
Plugin: vite:css
File: D:/my app/nuxt/macxplore/components/Appheader.vue?vue&type=style&index=0&scoped=true&lang.scss
at loadPreprocessor (D:\my app\nuxt\macxplore\node_modules\vite\dist\node\chunks\dep-11db14da.js:28689:15)
at scss (D:\my app\nuxt\macxplore\node_modules\vite\dist\node\chunks\dep-11db14da.js:28694:20)
at compileCSS (D:\my app\nuxt\macxplore\node_modules\vite\dist\node\chunks\dep-11db14da.js:28438:40)
at async TransformContext.transform (D:\my app\nuxt\macxplore\node_modules\vite\dist\node\chunks\dep-11db14da.js:28108:50)
at async Object.transform (D:\my app\nuxt\macxplore\node_modules\vite\dist\node\chunks\dep-11db14da.js:50885:30)
at async transformRequest (D:\my app\nuxt\macxplore\node_modules\vite\dist\node\chunks\dep-11db14da.js:66636:29)
at async viteTransformMiddleware (D:\my app\nuxt\macxplore\node_modules\vite\dist\node\chunks\dep-11db14da.js:66774:32)
I can also the same error when I was trying to use global css config which works fine without nuxt-vite. Also tried using the below config
export default {
css: ["@/assets/scss/global.scss"],
vite: {
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "@/assets/scss/global.scss";',
},
},
},
},
}
Also worth noting that rolling back to 2.3.8 seems to bypass the issue, so this seems to be something that was added after 2.3.8.
I set the following settings in package.json, and It works fine.
"resolutions": {
"vite": "2.3.8"
}
Is this a vite problem and not a nuxt-vite problem, right?
@ishiijp yes, I have faced same issue when using nuxt-vite
whenever the same project work using only nuxt
.
Same issue. Sass isn't found despite being installed and it works fine if nuxt-vite
is disabled. It appears to be an issue affecting Vite versions 2.4+, and nuxt-vite
uses ^2.3.4
.
ERROR Preprocessor dependency "sass" not found. Did you install it? 09:56:34
at loadPreprocessor (node_modules/vite/dist/node/chunks/dep-c1a9de64.js:28714:15)
at scss (node_modules/vite/dist/node/chunks/dep-c1a9de64.js:28719:20)
at compileCSS (node_modules/vite/dist/node/chunks/dep-c1a9de64.js:28459:40)
at async TransformContext.transform (node_modules/vite/dist/node/chunks/dep-c1a9de64.js:28113:50)
at async Object.transform (node_modules/vite/dist/node/chunks/dep-c1a9de64.js:50939:30)
at async transformRequest (node_modules/vite/dist/node/chunks/dep-c1a9de64.js:66763:29)
at async warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:386:5)
at async Promise.all (index 6)
at async warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:388:5)
at async Promise.all (index 8)
at async warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:388:5)
at async Promise.all (index 4)
at async warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:388:5)
at async Promise.all (index 0)
at async warmupViteServer (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:390:3)
Pinning the Vite version at 2.3.8 seemed to remove that error for me, but it introduced a new one:
ERROR Cannot read property 'importedModules' of undefined 10:06:56
at warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:387:71)
at async Promise.all (index 4)
at async warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:388:5)
at async Promise.all (index 5)
at async warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:388:5)
at async Promise.all (index 8)
at async warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:388:5)
at async Promise.all (index 4)
at async warmup (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:388:5)
at async Promise.all (index 0)
at async warmupViteServer (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:390:3)
Rolling back to Vite 2.3.4 did not resolve the above error.
Here's a recreation with a fresh install https://githubbox.com/selfagency/vite-sass-error
@pi0 just wanted to make sure you saw this, it's a significant problem
/cc @antfu would appreciate it if you have time to check on this. According to vitejs/vite#4557 (comment), it can be from jiti but we already fill it from native require.resolve.paths
.
How it is closed? having facing this issue. using
"nuxt-vite": "^0.2.2", "sass": "1.32.13", "sass-loader": "10.1.1",
Same for me. Still not able to compile.
We are still pending for Vite to release
We are still pending for Vite to release
yes, vite release: v2.5.4 update and fixed. :) thank youuu
Released v0.2.4 with Vite version bumpped, should work out-of-box now.