bootswatch icon indicating copy to clipboard operation
bootswatch copied to clipboard

Vue3/Laravel npm error

Open Shadercloud opened this issue 2 years ago • 2 comments

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);
}

Shadercloud avatar Aug 10 '22 07:08 Shadercloud

I have the same issue. Please fix this asap.

tobiasreinhard avatar Aug 25 '22 08:08 tobiasreinhard

~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.

dayflower avatar Oct 13 '22 08:10 dayflower