Storybook: Unexpected token (css and sass) - addon-storyshots

Created on 24 Jan 2018  路  3Comments  路  Source: storybookjs/storybook

Issue details

I get an Unexpected token error when running the Storyshots test. It happens at the @import from a SCSS file as well as the first bracket of a CSS file.

Stories work correctly but snapshot tests do not.

Steps to reproduce

Import in the .storybook/config.js an SCSS or CSS file and run the test.

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/react 3.1.9
  • @storybook/addon-storyshots 3.3.10
question / support

Most helpful comment

@igor-dv I'm using Storybook for React. Sorry for not clarifying the versions I'm using (markdown hid the first part). I just fixed it.

I have Storyshots working now. I had to install jest-css-modules and add "scriptPreprocessor": "<rootDir>/node_modules/jest-css-modules" to my jest configuration on package.json.

All 3 comments

@jsanes can you please share your config.js / webpack.config.js / sotryshots test file?
Also, you've specified versions of something that is not clear what (And those versions are not matching, which is wrong). Do you use Storybook for react/angular/vue?

@igor-dv I'm using Storybook for React. Sorry for not clarifying the versions I'm using (markdown hid the first part). I just fixed it.

I have Storyshots working now. I had to install jest-css-modules and add "scriptPreprocessor": "<rootDir>/node_modules/jest-css-modules" to my jest configuration on package.json.

Cool !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miljan-aleksic picture miljan-aleksic  路  3Comments

levithomason picture levithomason  路  3Comments

wahengchang picture wahengchang  路  3Comments

purplecones picture purplecones  路  3Comments

arunoda picture arunoda  路  3Comments