Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SassError: Invalid CSS after "": expected 1 selector or at-rule #2896

Closed
jauggy opened this issue Aug 27, 2020 · 3 comments
Closed

SassError: Invalid CSS after "": expected 1 selector or at-rule #2896

jauggy opened this issue Aug 27, 2020 · 3 comments

Comments

@jauggy
Copy link

jauggy commented Aug 27, 2020

I have a scss file added to my project where I just @import another scss file. However, I get an error when running yarn storybook.

Here's my styles.scss file:

// Import CoreUI styles
@import "~@coreui/coreui/scss/coreui.scss";

Here's the error:
https://i.stack.imgur.com/Zzd5h.png

Here's .storybook/main.js which has webpack config:

const path = require("path");

module.exports = {
  stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
  addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/preset-create-react-app",
  ],
  webpackFinal: async (config, { configType }) => {
    // `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
    // You can change the configuration based on that.
    // 'PRODUCTION' is used when building the static version of storybook.

    // Make whatever fine-grained changes you need
    config.module.rules.push({
      test: /\.scss$/,
      use: ["style-loader", "css-loader", "sass-loader"],
      include: path.resolve(__dirname, "../"),
    });

    // Return the altered config
    return config;
  },
};
@Awjin
Copy link
Contributor

Awjin commented Aug 27, 2020

This appears to be an error with the build system, unrelated to the Sass language. (Perhaps a duplicate of webpack-contrib/sass-loader#862)?

@Awjin Awjin closed this as completed Aug 27, 2020
@bsmolyansky
Copy link

Was this ever resolved? I have the same exact error.

@InSuperposition
Copy link

In v6 the import for global styles should be declared in .storybook/preview.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants