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

initStoryshots() will cause error of Cannot find module '@storybook/vue/dist/server/babel_config' from 'config-loader.js' #4592

Closed adamchenwei closed 5 years ago

adamchenwei commented 5 years ago

Describe the bug When execute jest, if there is initStoryshots() in the test file, I will encounter Cannot find module '@storybook/vue/dist/server/babel_config' from 'config-loader.js' error.

To Reproduce Steps to reproduce the behavior:

  1. git clone git@github.com:adamchenwei/vuejs-playground.git (https://github.com/adamchenwei/vuejs-playground)
  2. git checkout step/3-3-2-B-storybook-storyshot-broken
  3. npm run setup
  4. npm run test

Expected behavior should generate snapshot without issue when run jest Screenshots Error screen shot 2018-10-26 at 12 44 32 pm

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

System:

"dependencies": {
    "vue": "^2.5.17",
    "vue-router": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.1.2",
    "@babel/preset-env": "^7.1.0",
    "@storybook/addon-storyshots": "^3.4.11",
    "@storybook/vue": "^4.0.0-rc.6",
    "@vue/babel-preset-app": "^3.0.5",
    "@vue/test-utils": "^1.0.0-beta.25",
    "babel-core": "^7.0.0-bridge.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^23.6.0",
    "babel-loader": "^8.0.4",
    "babel-preset-env": "^1.7.0",
    "babel-preset-vue": "^2.0.2",
    "copy-webpack-plugin": "^4.5.4",
    "css-loader": "^1.0.0",
    "eslint": "^5.7.0",
    "eslint-config-standard": "^12.0.0",
    "eslint-loader": "^2.1.1",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-node": "^7.0.1",
    "eslint-plugin-promise": "^4.0.1",
    "eslint-plugin-standard": "^4.0.0",
    "eslint-plugin-vue": "^4.7.1",
    "html-webpack-plugin": "^3.2.0",
    "jest": "^23.6.0",
    "jest-serializer-vue": "^2.0.2",
    "jest-transform-stub": "^1.0.0",
    "jest-vue-preprocessor": "^1.4.0",
    "node-sass": "^4.9.4",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.23.1",
    "vue-jest": "^3.0.0",
    "vue-loader": "^15.4.2",
    "vue-style-loader": "^4.1.2",
    "vue-template-compiler": "^2.5.17",
    "webpack": "^4.23.0",
    "webpack-cli": "^3.1.2",
    "webpack-dev-server": "^3.1.10"
  }

Additional context Add any other context about the problem here.

igor-dv commented 5 years ago

Please use every @strorybook/* related dep from the same version.

adamchenwei commented 5 years ago

that worked! thanks @igor-dv save the day!