shakacode / bootstrap-sass-loader

Webpack Loader for the Sass version Twitter Bootstrap
MIT License
118 stars 25 forks source link

File to import not found or unreadable with sass-loader 1.0.3 #23

Closed swolidity closed 9 years ago

swolidity commented 9 years ago

Hey Justin,

I'm not sure if this is a problem with your bootstrap-sass-loader or sass-loader but I thought I would let you know. My setup can be found in my repo isomorphic-react-example. My code base is based off of react-starter-kit and I run my webpack config and bundling through gulpfile.babel.js.

When I attempted to bundle bootstrap with your loader and sass-loader@1.0.3 I got the following error message:

ERROR in ./~/extract-text-webpack-plugin/loader.js?{"omit":1,"extract":true,"remove":true}!./~/style-loader!./~/css-loader!./~/sass-loader?sourceMap!./~/bootstrap-sass-loader/bootstrap-sass-styles.loader.js!./bootstrap-sass.config.js
Module build failed: ModuleBuildError: Module build failed: 
var ExtractTextPlugin = require('extract-text-webpack-plugin');
       ^
      File to import not found or unreadable: Users/akay/devel/isomorphic-react-example/node_modules/bootstrap-sass/assets/stylesheets/bootstrap/variables.scss
      in /Users/akay/devel/isomorphic-react-example/bootstrap-sass.config.js (line 1, column 9)
    at DependenciesBlock.onModuleBuildFailed (/Users/akay/devel/isomorphic-react-example/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:315:19)
    at nextLoader (/Users/akay/devel/isomorphic-react-example/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:270:31)
    at /Users/akay/devel/isomorphic-react-example/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15
    at context.callback (/Users/akay/devel/isomorphic-react-example/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:148:14)
    at Object.onRender (/Users/akay/devel/isomorphic-react-example/node_modules/sass-loader/index.js:160:13)
    at options.error (/Users/akay/devel/isomorphic-react-example/node_modules/node-sass/lib/index.js:279:32)
 @ ./~/bootstrap-sass-loader/index.loader.js!./bootstrap-sass.config.js 1:0-369

However, if I downgrade to sass-loader@1.0.2 everything compiles fine.

justin808 commented 9 years ago

I'm seeing a possibly related issue here, when using node 0.12.7: https://github.com/justin808/react-webpack-rails-tutorial/issues/52

jorrit commented 9 years ago

See jtangelder/sass-loader#126 . Downgrade to sass-loader 1.0.2 if the improvements of 1.0.3 don't matter for you.

jorrit commented 9 years ago

This would also be fixed, I think, when addImportReturnDependency writes a relative path instead of an absolute path, using path.relative().

geminiyellow commented 9 years ago

@jorrit not working for me. this loader not working.

mmahalwy commented 9 years ago

@geminiyellow & @adavkay just downgrade to sass-loader 1.0.2 for now, see: https://github.com/justin808/bootstrap-sass-loader/issues/22

justin808 commented 9 years ago

@jorrit Could you file a PR if that works and works with the older version as well?

jorrit commented 9 years ago

Done, see #25.

jorrit commented 9 years ago

When I npm link the changed version, @mmahalwy 's code runs, even with sass-loader 1.0.3.

mmahalwy commented 9 years ago

@jorrit thanks for getting to that. I appreciate it!