storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.22k stars 9.26k forks source link

storyshot for storybook/vue broken with error Module not found: Error: Can't resolve 'fs' #4793

Closed adamchenwei closed 5 years ago

adamchenwei commented 5 years ago

Describe the bug Massive cant resolve 'fs' came up with storyshot config after jest already configed and storybook was running correctly.

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/adamchenwei/boilerplate-webpack-babel-sass-storybook-vuejs
  2. git checkout broken/start-after-storyshot-setup
  3. npm install && npm run storybook
  4. See error

Expected behavior storyshot should not cause error prevent storybook run correctly

Screenshots

screen shot 2018-11-15 at 1 08 01 pm screen shot 2018-11-15 at 1 08 12 pm screen shot 2018-11-15 at 1 08 19 pm

Code snippets If applicable, add code samples to help explain your problem.

System:

igor-dv commented 5 years ago

Storyshots are used only for testing, which means during the test run in Node.

You've included them in config.js which is loaded into browser: https://github.com/adamchenwei/boilerplate-webpack-babel-sass-storybook-vuejs/blob/broken/start-after-storyshot-setup/.storybook/config.js#L2

You need to create a test file and init the storyshots there. Please address to docs. LMK if you need any help.