You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The loadSassPackage() function loads sass-embedded without validating that the module is functional and falling back to the sass package where possible (with a warning or something). The sass-embedded package seems to install on any system, regardless of the availability of the needed Dart sass binary. So the import succeeds in loadSassPackage() but will later fail when the pre-processor is actually used.
Quasar installs sass-embedded as a dependency. Vite will try to use the package, but the build will fail with [vite:css] [sass] Embedded Dart Sass couldn't find the embedded compiler executable. Please make sure the optional dependency sass-embedded-freebsd-x64 is installed in node_modules. Of course that package does not exist (and likely never will).
Installing sass and then manually removing sass-embedded from package-lock and node_modules allows project to build. There might be a more elegant way to do it with overrides, but ideally Vite would be able to test/detect that sass-embedded does not work on the platform and fall back to sass before failing.
This isn't really FreeBSD-specific; ideally Vite would fall back to sass if the architecture-specific sass-embedded-<arch> isn't available.
Build mode............. spa
Pkg quasar............. v2.17.7
Pkg @quasar/app-vite... v2.1.1
Pkg vite............... v6.2.0
Debugging.............. enabled
Publishing............. no
App • Using quasar.config.ts in "ts" format
App • WAIT • Compiling of SPA UI with Vite in progress...
✗ Build failed in 368ms
[vite:css] [sass] [sass] Embedded Dart Sass couldn't find the embedded compiler executable. Please make sure the optional dependency sass-embedded-freebsd-x64 is installed in node_modules.
file: /home/wmorgan/vue/quasar-project/node_modules/quasar/dist/quasar.sass
at /home/wmorgan/vue/quasar-project/node_modules/sass-embedded/dist/lib/src/compiler-path.js:58:11
at Object.<anonymous> (/home/wmorgan/vue/quasar-project/node_modules/sass-embedded/dist/lib/src/compiler-path.js:62:3)
at Module._compile (node:internal/modules/cjs/loader:1554:14)
at Object..js (node:internal/modules/cjs/loader:1706:10)
at Module.load (node:internal/modules/cjs/loader:1289:32)
at Function._load (node:internal/modules/cjs/loader:1108:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
at Module.require (node:internal/modules/cjs/loader:1311:12)
at require (node:internal/modules/helpers:136:16) {
id: '/home/wmorgan/vue/quasar-project/node_modules/quasar/dist/quasar.sass',
frame: undefined,
code: 'PLUGIN_ERROR',
plugin: 'vite:css',
hook: 'transform',
watchFiles: [
'/home/wmorgan/vue/quasar-project/index.html',
'/home/wmorgan/vue/quasar-project/.quasar/prod-spa/client-entry.js',
'/home/wmorgan/vue/quasar-project/package.json',
'/home/wmorgan/vue/quasar-project/node_modules/vue/dist/vue.runtime.esm-bundler.js',
'/home/wmorgan/vue/quasar-project/node_modules/@quasar/extras/roboto-font/roboto-font.css',
'/home/wmorgan/vue/quasar-project/node_modules/@quasar/extras/material-icons/material-icons.css',
'/home/wmorgan/vue/quasar-project/src/css/app.scss',
'/home/wmorgan/vue/quasar-project/.quasar/prod-spa/app.js',
'/home/wmorgan/vue/quasar-project/.quasar/prod-spa/quasar-user-options.js',
'/home/wmorgan/vue/quasar-project/node_modules/quasar/dist/quasar.sass'
]
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
The
loadSassPackage()
function loadssass-embedded
without validating that the module is functional and falling back to thesass
package where possible (with a warning or something). Thesass-embedded
package seems to install on any system, regardless of the availability of the needed Dartsass
binary. So the import succeeds inloadSassPackage()
but will later fail when the pre-processor is actually used.Quasar installs sass-embedded as a dependency. Vite will try to use the package, but the build will fail with
[vite:css] [sass] Embedded Dart Sass couldn't find the embedded compiler executable. Please make sure the optional dependency sass-embedded-freebsd-x64 is installed in node_modules
. Of course that package does not exist (and likely never will).Installing
sass
and then manually removingsass-embedded
from package-lock and node_modules allows project to build. There might be a more elegant way to do it with overrides, but ideally Vite would be able to test/detect thatsass-embedded
does not work on the platform and fall back tosass
before failing.This isn't really FreeBSD-specific; ideally Vite would fall back to
sass
if the architecture-specificsass-embedded-<arch>
isn't available.Reproduction
https://sorry.dont.have.one
Steps to reproduce
How to replicate (with Quasar because it will preprocess sass by default):
pkg install npm
npm init quasar@latest
npx quasar build
in the project directory, will fail looking forsass-embedded-freebsd-x64
npm i sass
,npx quasar build
, still failsnpx quasar build
, should succeed.System Info
Used Package Manager
npm
Logs
Debug log of build output:
Validations
The text was updated successfully, but these errors were encountered: