Preact-cli: SASS: File to import not found or unreadable

Created on 31 May 2017  路  2Comments  路  Source: preactjs/preact-cli

importing scss seems to fail in index.scss

./~/css-loader?modules&localIdentName=[local]__[hash:base64:5]&importLoaders=1&sourceMap=false!./~/postcss-loader!./~/preact-cli/lib/lib/npm-install-loader.js?{"modules":["node-sass","sass-loader"],"save":true}!./~/preact-cli/~/sass-loader/lib/loader.js?{"sourceMap":true}!./components/header/style.scss Module build failed: @import "themes/light"; ^ File to import not found or unreadable: themes/light. Parent style sheet: stdin in /Users/avivek/Hack/experiments/preact/graburs/components/header/style.scss (line 1, column 1) @ ./components/header/style.scss 4:14-350 13:2-17:4 14:20-356 @ ./components/header/index.js @ ./index.js @ ./~/preact-cli/lib/lib/entry.js @ multi ./~/preact-cli/lib/lib/entry webpack-dev-server/client?http://0.0.0.0:8080/ webpack/hot/dev-server?http://0.0.0.0:8080/

question

Most helpful comment

Hi @ajviv - you need to use a relative path, otherwise Webpack will assume you're looking for a file called "light" inside an npm module called "themes".

@import "./themes/light";

All 2 comments

Hi @ajviv - you need to use a relative path, otherwise Webpack will assume you're looking for a file called "light" inside an npm module called "themes".

@import "./themes/light";

馃憤 That works

Was this page helpful?
0 / 5 - 0 ratings