Parcel: Resolver fails with bootstrap3 sass import

Created on 8 Apr 2018  路  4Comments  路  Source: parcel-bundler/parcel

Choose one: is this a 馃悰 bug report or 馃檵 feature request?
bug report

馃槸 Current Behavior

the resolver fails when building a sass file with the following:

// Bootstrap Framework.
// $icon-font-path: "../../node_modules/bootstrap-sass/assets/fonts/bootstrap/";
@import "../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap-sprockets";
@import "../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap";

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.7.0
| Node | 8.9.4
| npm/Yarn | 1.5.1
| Operating System | osx 10.13.3

Bug

Most helpful comment

I'm not sure how this is a SASS issue. I run node-sass src/styles.scss and everything "just works". If I import ./styles.scss into my index.js and build with parcel, I start getting these same resolver errors.

I do not have any custom node-sass configs or resolvers--just using the raw node-sass cli works fine.

All 4 comments

Sounds like a SASS issue. We don't currently override the SASS resolver in any way. Could you provide more info about the error you're seeing?

oops, sorry about that, I thought I included the error. unfortunately, the error output get cut off bit by the at Resolver.resolve ... line

/Users/rjewing/code/biocode/biscicol-ui/src/style/app.scss: Cannot resolve dependency './node_modules/bootstrap-sass/assets/fonts/bootstrap/glyphicons-halflings-regular.eot%22)' at '/Users/rjewing/code/biocode/biscicol-ui/src/st    at Resolver.resolve (/Users/rjewing/code/biocode/biscicol-ui/node_modules/parcel-bundler/src/Resolver.js:76:17)
    at <anonymous>

I'm not sure how this is a SASS issue. I run node-sass src/styles.scss and everything "just works". If I import ./styles.scss into my index.js and build with parcel, I start getting these same resolver errors.

I do not have any custom node-sass configs or resolvers--just using the raw node-sass cli works fine.

Problem starts when you try to import boostrap.scss file directly from node_modules. It doesn't work, you have to create your own .scss file outside node_modules dir, from where you will call different .scss modules, including yours that override bootstrap defaults.

I wonder why parcel doesn't fix that, bucause it's quite old problem.

Was this page helpful?
0 / 5 - 0 ratings