[Bug] [vite] Uncaught TypeError: Cannot read properties of undefined (reading 'custom') at .yarn/cache/object-inspect-npm-1.12.2-f125a822c0-a534fc1b85.zip/node_modules/object-inspect/index.js (index.js:69:33)
See original GitHub issueWhat version of vite
are you using?
^2.9.9
System info and storybook versions
System: OS: Windows 10 10.0.22621 CPU: (16) x64 12th Gen Intel® Core™ i5-12600K Binaries: Node: 16.15.1 - C:\Program Files\nodejs\node.EXE Yarn: 3.2.1 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.12.2 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.22621.160.0), Chromium (103.0.1264.37)
"@storybook/addon-actions": "^6.5.9",
"@storybook/addon-docs": "^6.5.9",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-interactions": "^6.5.9",
"@storybook/addon-links": "^6.5.9",
"@storybook/builder-vite": "^0.1.38",
"@storybook/core-common": "^6.5.9",
"@storybook/node-logger": "^6.5.9",
"@storybook/react": "^6.5.9",
"@storybook/testing-library": "^0.0.13",
Describe the Bug
When using Yarn PnP with Storybook in a Vite project I get this error when running yarn storybook
.
Uncaught TypeError: Cannot read properties of undefined (reading 'custom') at .yarn/cache/object-inspect-npm-1.12.2-f125a822c0-a534fc1b85.zip/node_modules/object-inspect/index.js (index.js:69:33) at __require2 (chunk-CCD2FOVN.js?v=5a6567aa:18:50) at .yarn/cache/side-channel-npm-1.0.4-e1f38b9e06-351e41b947.zip/node_modules/side-channel/index.js (index.js:5:15) at __require2 (chunk-CCD2FOVN.js?v=5a6567aa:18:50) at .yarn/cache/qs-npm-6.11.0-caf1bc9dea-6e1f29dd53.zip/node_modules/qs/lib/stringify.js (stringify.js:3:22) at __require2 (chunk-CCD2FOVN.js?v=5a6567aa:18:50) at .yarn/cache/qs-npm-6.11.0-caf1bc9dea-6e1f29dd53.zip/node_modules/qs/lib/index.js (index.js:3:17) at __require2 (chunk-CCD2FOVN.js?v=5a6567aa:18:50) at UrlStore.js:30:16
In the minimal reproducible example I just did :
yarn create vite my-vue-app --template react-ts
// to create a vite project with react typescript
yarn set version berry
// to set yarn version to Yarn v2
then I made sure that wasn’t any nodeLinker: node-modules
in my .yarnrc.yml
so PnP was truly activated
npx storybook init
// to install Storybook
PS: I had many errors before about undeclared peerDependencies :
- @storybook/core-common
- @storybook/node-logger and missing dependencies :
- @storybook/preview-web,
- @storybook/addon-docs,
- @storybook/client-api,
- @storybook/addon-backgrounds,
- @storybook/addon-measure,
- @storybook/addon-outline,
- @storybook/channel-postmessage,
- @storybook/channel-websocket,
- @storybook/addons
but I managed to solve those problems installing them as dependencies of my project.
yarn add -D @storybook/core-common @storybook/node-logger @storybook/preview-web ...
Link to Minimal Reproducible Example
https://github.com/fivaz/react-storybook-vue
Participation
- I am willing to submit a pull request for this issue.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (1 by maintainers)
Personally I had to install all those one with PNPM:
facing the
Faced the same issue with Pnpm, adding these dependencies manually helped!