[Bug] Failed to resolve import "global" with yarn PNP
See original GitHub issueWhat version of vite
are you using?
2.9.8
System info and storybook versions
System: OS: Windows 10 10.0.22000 CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor Binaries: Node: 16.13.1 - C:\Program Files\nodejs\node.EXE Yarn: 3.2.0 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.6.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.22000.120.0), Chromium (101.0.1210.32)
Describe the Bug
When using storybook and this build with Yarn P’n’P ‘global’ cannot be found.
Stack trace:
[vite] Internal server error: Failed to resolve import "global" from "..\..\..\..\virtual:\@storybook\builder-vite\setup-addons.js". Does the file exist? Plugin: vite:import-analysis File: /virtual:/@storybook/builder-vite/setup-addons.js 1 | import global from 'global'; | ^ 2 | import createPostMessageChannel from '@storybook/channel-postmessage'; 3 | import createWebSocketChannel from '@storybook/channel-websocket';
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Repro: https://github.com/Arnagos/import-global-repro
This is fixed by https://github.com/storybookjs/builder-vite/pull/383. Can you please try version 0.1.34? You may hit other problems, though, as detailed in https://github.com/storybookjs/builder-vite/issues/141