storybookjs / storybook

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

[Bug]: Module not found: Error: Can't resolve '@storybook/preview-web' since `v6.5.14` #20112

Closed mickaelzhang closed 1 year ago

mickaelzhang commented 1 year ago

Describe the bug

It seems the last version (v6.5.14), I'm getting this error:

ModuleNotFoundError: Module not found: Error: Can't resolve '@storybook/preview-web' in '/Users/mickaelzhang/Development/smores-react'
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/Compilation.js:2016:28
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:798:13
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:270:22
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:434:22
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:116:11
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:670:25
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:855:8
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:975:5
    at /Users/mickaelzhang/Development/smores-react/node_modules/neo-async/async.js:6883:13
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:958:45
    at finishWithoutResolve (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:312:11)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:386:15
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:16:12
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/AliasPlugin.js:125:14
    at next (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:14:3)
    at forEachBail (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:24:9)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/AliasPlugin.js:51:5
    at _next0 (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:1)
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:30:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js:41:15
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
resolve '@storybook/preview-web' in '/Users/mickaelzhang/Development/smores-react'
  Parsed request is a module
  using description file: /Users/mickaelzhang/Development/smores-react/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      looking for modules in /Users/mickaelzhang/Development/smores-react/node_modules
        single file module
          using description file: /Users/mickaelzhang/Development/smores-react/package.json (relative path: ./node_modules/@storybook/preview-web)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web.jsx doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web.ts doesn't exist
            .tsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web.tsx doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web.json doesn't exist
            .cjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web.cjs doesn't exist
        /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/preview-web doesn't exist
      /Users/mickaelzhang/Development/node_modules doesn't exist or is not a directory
      /Users/mickaelzhang/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
ModuleNotFoundError: Module not found: Error: Can't resolve '@storybook/store' in '/Users/mickaelzhang/Development/smores-react'
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/Compilation.js:2016:28
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:798:13
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:270:22
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:434:22
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:116:11
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:670:25
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:855:8
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:975:5
    at /Users/mickaelzhang/Development/smores-react/node_modules/neo-async/async.js:6883:13
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:958:45
    at finishWithoutResolve (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:312:11)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:386:15
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:16:12
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/AliasPlugin.js:125:14
    at next (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:14:3)
    at forEachBail (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:24:9)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/AliasPlugin.js:51:5
    at _next0 (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:1)
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:30:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js:41:15
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
resolve '@storybook/store' in '/Users/mickaelzhang/Development/smores-react'
  Parsed request is a module
  using description file: /Users/mickaelzhang/Development/smores-react/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      looking for modules in /Users/mickaelzhang/Development/smores-react/node_modules
        single file module
          using description file: /Users/mickaelzhang/Development/smores-react/package.json (relative path: ./node_modules/@storybook/store)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store.jsx doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store.ts doesn't exist
            .tsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store.tsx doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store.json doesn't exist
            .cjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store.cjs doesn't exist
        /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/store doesn't exist
      /Users/mickaelzhang/Development/node_modules doesn't exist or is not a directory
      /Users/mickaelzhang/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
ModuleNotFoundError: Module not found: Error: Can't resolve '@storybook/channel-websocket' in '/Users/mickaelzhang/Development/smores-react'
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/Compilation.js:2016:28
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:798:13
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:270:22
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:434:22
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:116:11
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:670:25
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:855:8
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:975:5
    at /Users/mickaelzhang/Development/smores-react/node_modules/neo-async/async.js:6883:13
    at /Users/mickaelzhang/Development/smores-react/node_modules/webpack/lib/NormalModuleFactory.js:958:45
    at finishWithoutResolve (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:312:11)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:386:15
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:16:12
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/AliasPlugin.js:125:14
    at next (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:14:3)
    at forEachBail (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/forEachBail.js:24:9)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/AliasPlugin.js:51:5
    at _next0 (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:1)
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:30:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:87:43
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/Resolver.js:435:5
    at eval (eval at create (/Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /Users/mickaelzhang/Development/smores-react/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js:41:15
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
resolve '@storybook/channel-websocket' in '/Users/mickaelzhang/Development/smores-react'
  Parsed request is a module
  using description file: /Users/mickaelzhang/Development/smores-react/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      looking for modules in /Users/mickaelzhang/Development/smores-react/node_modules
        single file module
          using description file: /Users/mickaelzhang/Development/smores-react/package.json (relative path: ./node_modules/@storybook/channel-websocket)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket doesn't exist
            .mjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket.mjs doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket.jsx doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket.ts doesn't exist
            .tsx
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket.tsx doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket.json doesn't exist
            .cjs
              Field 'browser' doesn't contain a valid alias configuration
              /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket.cjs doesn't exist
        /Users/mickaelzhang/Development/smores-react/node_modules/@storybook/channel-websocket doesn't exist
      /Users/mickaelzhang/Development/node_modules doesn't exist or is not a directory
      /Users/mickaelzhang/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory

To Reproduce

1. Clone https://github.com/marshmallow-insurance/smores-react
2. `npm install`
3. `npm run start`

You should get the error

System

Environment Info:

  System:
    OS: macOS 12.6.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.10.0/bin/yarn
    npm: 7.24.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.94
    Firefox: 107.0.1
    Safari: 15.6.1
  npmPackages:
    @storybook/addon-essentials: ^6.2.6 => 6.5.14
    @storybook/builder-webpack5: ^6.5.13 => 6.5.14
    @storybook/manager-webpack5: ^6.5.13 => 6.5.14
    @storybook/react: ^6.2.6 => 6.5.14
    @storybook/storybook-deployer: ^2.8.7 => 2.8.16


### Additional context

The error started to appear after this commit:
https://github.com/marshmallow-insurance/smores-react/commit/1ee4fbf90ed9d21f95dab6c745d8c268a8ae6f86)https://github.com/marshmallow-insurance/smores-react/pull/2407
valentinpalkovic commented 1 year ago

Hey @mickaelzhang,

I was able to reproduce the issue!

Please try the following steps to fix it:

  1. Delete your package-lock.json
  2. Use the latest build and storybook related dependencies in your package.json
{
  "name": "@mrshmllw/smores-react",
  "version": "2.12.1",
  "main": "./dist/index.js",
  "description": "Collection of React components used by Marshmallow Technology",
  "keywords": [
    "react",
    "components",
    "design system",
    "component library"
  ],
  "files": [
    "dist"
  ],
  "scripts": {
    "build-storybook": "build-storybook -c .storybook -s public",
    "check-types": "tsc --noEmit",
    "deploy-storybook": "storybook-to-ghpages",
    "prepublishOnly": "tsc",
    "publish-npm": "npm publish --access public",
    "start": "npm run storybook",
    "storybook": "start-storybook -p 6006 ",
    "test:coverage": "jest --coverage --silent",
    "test:watch": "jest --watch --silent",
    "test": "jest --silent",
    "snyk-protect": "snyk-protect",
    "prepare": "npm run snyk-protect && husky install",
    "pre-commit-lint": "npm run check-types && lint-staged",
    "fix-package-lock-conflicts": "echo \"Make sure conflicts in package.json are resolved before running this script\" && npm i --package-lock-only"
  },
  "devDependencies": {
    "@babel/core": "^7.20.5",
    "@babel/plugin-proposal-class-properties": "^7.18.6",
    "@babel/preset-env": "^7.20.2",
    "@babel/preset-react": "^7.18.6",
    "@babel/preset-typescript": "^7.18.6",
    "@snyk/protect": "^1.881.0",
    "@storybook/addon-essentials": "^6.5.14",
    "@storybook/builder-webpack5": "^6.5.14",
    "@storybook/manager-webpack5": "^6.5.14",
    "@storybook/react": "^6.5.14",
    "@storybook/storybook-deployer": "^2.8.16",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^13.4.0",
    "@types/jest": "^29.0.0",
    "@types/node": "^18.0.0",
    "@types/react": "^18.0.24",
    "@types/react-dom": "^18.0.8",
    "@types/styled-components": "^5.1.3",
    "@types/testing-library__jest-dom": "^5.14.3",
    "@types/testing-library__react": "^10.2.0",
    "@typescript-eslint/eslint-plugin": "^5.31.0",
    "@typescript-eslint/parser": "^5.31.0",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^29.0.2",
    "babel-loader": "^9.1.0",
    "eslint": "^7.9.0",
    "eslint-config-prettier": "^8.2.0",
    "eslint-plugin-jest": "^27.0.1",
    "eslint-plugin-react": "^7.29.2",
    "eslint-plugin-react-hooks": "^4.1.2",
    "husky": "^8.0.1",
    "jest": "^29.0.2",
    "jest-environment-jsdom": "^29.0.2",
    "jest-styled-components": "^7.0.3",
    "lint-staged": "^13.0.0",
    "prettier": "^2.1.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "styled-components": "^5.2.1",
    "typescript": "^4.4.2"
  },
  "dependencies": {
    "date-fns": "^2.16.1",
    "polished": "^4.1.3"
  },
  "peerDependencies": {
    "react": "^16.8.0 || ^17 || ^18",
    "react-dom": "^16.8.0 || ^17 || ^18"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/marshmallow-insurance/smores-react.git"
  },
  "author": "Todor Tsankov",
  "license": "MIT",
  "homepage": "https://github.com/marshmallow-insurance/smores-react#readme",
  "snyk": true
}
  1. Run npm i --legacy-peer-deps to install your dependencies.

Storybook should run again as expected. Could you try that out? :)

mickaelzhang commented 1 year ago

Hey @valentinpalkovic ,

This seems to have solved the issue, thanks!