Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v7] Invalid esm dist exists in @storybook/store #19501

Closed
0xDing opened this issue Oct 15, 2022 · 2 comments
Closed

[v7] Invalid esm dist exists in @storybook/store #19501

0xDing opened this issue Oct 15, 2022 · 2 comments

Comments

@0xDing
Copy link

0xDing commented Oct 15, 2022

Describe the bug
The dist/index.mjs file in the @storybook/store package is not really a valid esm
To Reproduce
https://github.com/0xDing/storybook-es-issue

System
Environment Info:

System:
OS: macOS 12.6
CPU: (10) arm64 Apple M1 Max
Binaries:
Node: 18.10.0 - /private/var/folders/pd/n93d7dmn1tvgzs__q_9lv__h0000gn/T/xfs-3e420a0b/node
Yarn: 3.2.4 - /private/var/folders/pd/n93d7dmn1tvgzs__q_9lv__h0000gn/T/xfs-3e420a0b/yarn
npm: 8.19.2 - ~/.volta/tools/image/npm/8.19.2/bin/npm
Browsers:
Chrome: 106.0.5249.119
Firefox: 105.0.3
Safari: 16.0
npmPackages:
@storybook/addon-docs: ^7.0.0-alpha.38 => 7.0.0-alpha.38
@storybook/addon-essentials: ^7.0.0-alpha.38 => 7.0.0-alpha.38
@storybook/addon-interactions: ^7.0.0-alpha.38 => 7.0.0-alpha.38
@storybook/addon-links: ^7.0.0-alpha.38 => 7.0.0-alpha.38
@storybook/react: ^7.0.0-alpha.38 => 7.0.0-alpha.38
@storybook/react-vite: ^7.0.0-alpha.38 => 7.0.0-alpha.38
@storybook/testing-library: ^0.0.13 => 0.0.13
@storybook/testing-react: ^1.3.0 => 1.3.0

Additional context

Vitest is a vite based test runner that runs in ESM. And, I have written two unit test files in reproduce repo:

The v6 test case works fine, while v7 has a Cannot find module error.
This looks like an error caused by the index.mjs file in @storybook/store importing the cjs version of lodash in a way that doesn't conform to the esm specification

@IanVS
Copy link
Member

IanVS commented Nov 4, 2022

Thanks for the issue, @0xDing, would you be willing to submit a PR to fix it?

@yannbf yannbf added the linear label Nov 6, 2022
@ndelangen
Copy link
Member

The lodash issue was fixed recently: #20443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants