React + Storybook + Sass: SassError: expected "{"
Asked Answered
S

0

7

I'm having issues trying to make Storybook read my .scss files. I've tried a bunch of different possible solutions, but none of those solved the problem. Here is the error that always pop up:

SassError: SassError: expected "{".
  ╷
1 │ var api = require("!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  │                                                                                                     ^
  ╵

There are no Sass errors in the project, since the app runs and loads the styles normally by react-scripts start.

Here is my project, if you want to reproduce the error: https://github.com/tchesa/virtual-meeting-ui/tree/storybook

make sure you are in branch storybook

In this example, i'm using storybook-addon-sass-postcss storybook's addon to setup sass loader, but i also tried push sass-loader to storybook's webpack through webpackFinal property and i ended in the same error.

Simla answered 3/6, 2022 at 22:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.