bootswatch
bootswatch copied to clipboard
Vue3/Laravel npm error
I have installed the bootswatch package via NPM on the Vue3/Laravel project.
I'm importing like this:
// Bootstrap
@import "bootswatch/dist/cosmo/variables";
@import 'bootstrap/scss/bootstrap';
@import "bootswatch/dist/cosmo/bootswatch";
Right away it gives the error on npm run dev
below:
Error: expected ")".
╷
9 │ @import url(../../node_modules/bootswatch/dist/cosmo/$web-font-path);
│ ^
╵
node_modules/bootswatch/dist/cosmo/_bootswatch.scss 9:15 @import
resources/sass/app.scss 11:9 root stylesheet
If I manually remove this from _bootswatch.scss then it compiles:
@if $web-font-path {
@import url($web-font-path);
}
I have the same issue. Please fix this asap.
~JUST A WORKAROUND:~ ~Not sure for the exact reason, but installing [email protected] resolves the issue on my environment at this moment.~
~(version of dart2js used by dart-sass was changed to 2.8.2 from 2.7.2 at [email protected])~
In my environment, I use vite as a bundler, and changing @import "bootswatch/dist/cosmo/variables";
to @import "node_modules/bootswatch/dist/cosmo/variables";
also resolved the issue.
But I think this might not help you.