storybookjs / storybook

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

Storybook with Web Components breaks if you ever install webpack and will never run again after removing it #15670

Open tsteuwer-accesso opened 3 years ago

tsteuwer-accesso commented 3 years ago

Describe the bug In a freshly created directory, if you npm init and then npx sb init, you can get Storybook to run. As soon as you npm i -D webpack and run npm run storybook, storybook no longer works, even if you remove webpack from your package.json and remove all node_modules and reinstall.

To Reproduce Run the following commands:

mkdir project
cd project
npm init
npx sb init
npm i -D lit-html
npm run storybook
// Choose the configuration for Web Components
// After installing, storybook runs fine
npm i -D webpack
npm run storybook
// Errors galore
vim package.json
// Remove webpack from your devDependencies
rm -rf node_modules
npm i
npm run storybook
// Errors galore and you can't ever run storybook again.

System

Environment Info:

  System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  Binaries:
    Node: 12.16.2 - ~/.nvm/versions/node/v12.16.2/bin/node
    npm: 6.14.4 - ~/.nvm/versions/node/v12.16.2/bin/npm
  Browsers:
    Chrome: 91.0.4472.77
    Firefox: 90.0
  npmPackages:
    @storybook/addon-actions: ^6.3.5 => 6.3.5 
    @storybook/addon-essentials: ^6.3.5 => 6.3.5 
    @storybook/addon-links: ^6.3.5 => 6.3.5 
    @storybook/web-components: ^6.3.5 => 6.3.5 

Additional context After installing webpack and even removing it, you can no longer run npm run storybook as there will always be lots of errors.

I also tried running npx webpack config which built the file and that still results in the same errors.

hanifmhd commented 1 year ago

any update on this?