[Storybook 6.0.0-rc.0] build fails on sass-loader
See original GitHub issueDescribe the bug
I’m testing upgrading my storybook 5.3 repo to 6. I haven’t changed the webpack.config.js
, but Storybook fails on build with:
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> @import "../../../assets/mixins";
Code snippets
const path = require("path");
const webpack = require('webpack');
const config = require('../package.json');
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
loaders: ["style-loader", "css-loader", "sass-loader"],
include: path.resolve(__dirname, "../"),
},
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
importLoaders: 1,
sourceMap: true,
},
},
],
},
{
test: /\.(ttf|eot|png|svg|gif|ico|woff(2)?)(\?[a-z0-9=&.]+)?$/,
loader: 'file-loader?name=[name].[ext]',
}
]
},
plugins: [
new webpack.DefinePlugin({
VERSION: JSON.stringify(config.version),
}),
],
};
System: Environment Info:
System: OS: macOS Mojave 10.14.6 CPU: (12) x64 Intel® Core™ i9-8950HK CPU @ 2.90GHz Binaries: Node: 10.21.0 - /usr/local/bin/node Yarn: 1.18.0 - /usr/local/Cellar/yarn/1.22.4/bin/yarn npm: 6.14.4 - /usr/local/bin/npm Browsers: Chrome: 83.0.4103.116 Edge: 81.0.416.77 Firefox: 76.0.1 Safari: 13.1.1 npmPackages: @storybook/addon-a11y: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addon-actions: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addon-backgrounds: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addon-docs: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addon-knobs: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addon-links: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addon-notes: 6.0.0-rc.0 => 6.0.0-alpha.6 @storybook/addon-options: 6.0.0-rc.0 => 6.0.0-alpha.29 @storybook/addon-storyshots: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addon-storysource: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addon-viewport: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/addons: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/react: 6.0.0-rc.0 => 6.0.0-rc.0 @storybook/source-loader: 6.0.0-rc.0 => 6.0.0-rc.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:23 (11 by maintainers)
Top GitHub Comments
I’m facing the same issue. Any leads?
@ndelangen