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

[Bug]: Doctrine does not provide an export named 'default' in v7.0.0-rc.0 #21523

Closed
bryanjtc opened this issue Mar 9, 2023 · 8 comments · Fixed by #21535
Closed

[Bug]: Doctrine does not provide an export named 'default' in v7.0.0-rc.0 #21523

bryanjtc opened this issue Mar 9, 2023 · 8 comments · Fixed by #21535

Comments

@bryanjtc
Copy link
Member

bryanjtc commented Mar 9, 2023

Describe the bug

The requested module '/.yarn/cache/doctrine-npm-3.0.0-c6f1615f04-fd7673ca77.zip/node_modules/doctrine/lib/doctrine.js?v=4047beba' does not provide an export named 'default'

To Reproduce

Run yarn storybook
https://github.com/bryanjtc/storybook-7-vite-test

System

Environment Info:

  System:
    OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
    CPU: (16) x64 AMD EPYC 7B13
  Binaries:
    Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
    Yarn: 3.4.1 - ~/.nvm/versions/node/v16.19.0/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm

Additional context

The repo uses yarn pnp.

@bryanjtc
Copy link
Member Author

bryanjtc commented Mar 9, 2023

Doctrine is used by @storybook/docs-tools. Here

import doctrine from 'doctrine';

@nickgros
Copy link

nickgros commented Mar 9, 2023

I'm seeing the same issue with pnpm + react-vite

@D1no
Copy link

D1no commented Mar 10, 2023

Same here
image

Resulted after running

cd tools && pnpx storybook@next upgrade --prerelease --skip-check

to upgrade from ^7.0.0-beta.63 → ^7.0.0-rc.0

In my stroybook-pnpm reproduction repo
https://github.com/D1no/reproduction-storybook-symlinks-pnpm

For this issue
#21399

Maybe related to PR
#21461

@sawden
Copy link

sawden commented Mar 10, 2023

I have the same issue with vite and pnpm.

@thtliife
Copy link
Contributor

see if adding doctrine to optimizeDeps.include array in your viteFinal config in main.js/main.ts helps? (example in #21527)

@shilman
Copy link
Member

shilman commented Mar 10, 2023

(Assuming the workaround from #21527 works, have not tested)

@shilman shilman moved this to Required for GA in Core Team Projects Mar 10, 2023
D1no added a commit to D1no/reproduction-storybook-symlinks-pnpm that referenced this issue Mar 12, 2023
…upgrade --prerelease --skip-check`, fixes `rc.0` doctrine regression

storybookjs/storybook#21399
FIXES storybookjs/storybook#21523
FIXES storybookjs/storybook#21527

Console: 
```bash
➜  tools git:(master) ✗ pnpx storybook@next upgrade --prerelease --skip-check
.../Library/pnpm/store/v3/tmp/dlx-97337  | +603 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.../Library/pnpm/store/v3/tmp/dlx-97337  | Progress: resolved 624, reused 581, downloaded 22, added 603, done
 • Checking for latest versions of '@storybook/*' packagesinfo ,Using pnpm
info Upgrading /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/package.json
info 
info  @storybook/addon-essentials    ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/addon-interactions  ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/addon-links         ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/blocks              ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/react               ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/react-vite          ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  storybook                      ^7.0.0-beta.63  →  ^7.0.0-rc.1
info 
info Run pnpm install to install new versions.
info ,
info 
info ,Using pnpm
info Upgrading /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/package.json
info 
info No dependencies.
info ,
 • Installing upgrades • Preparing to install dependencies. ✓


Packages: +809
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /Users/worker/Library/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 830, reused 781, downloaded 28, added 809, done

dependencies:
+ react 18.2.0
+ react-dom 18.2.0

devDependencies:
+ @storybook/addon-essentials 7.0.0-rc.1
+ @storybook/addon-interactions 7.0.0-rc.1
+ @storybook/addon-links 7.0.0-rc.1
+ @storybook/blocks 7.0.0-rc.1
+ @storybook/react 7.0.0-rc.1
+ @storybook/react-vite 7.0.0-rc.1
+ @storybook/testing-library 0.0.14-next.1
+ @types/react 18.0.28
+ @types/react-dom 18.0.11
+ prop-types 15.8.1
+ storybook 7.0.0-rc.1
+ typescript 4.9.5
+ vite 4.1.4

The integrity of 1217 files was checked. This might have caused installation to take longer.
Done in 16.2s
. ✓

attention => Storybook now collects completely anonymous telemetry regarding usage.
This information is used to shape Storybook's roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://storybook.js.org/telemetry

➜  tools git:(master) ✗ pnpm run storybook                                   

> tools@ storybook /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools
> storybook dev -p 6006

@storybook/cli v7.0.0-rc.1

info => Starting manager..
WARN No story files found for the specified pattern: stories/**/*.mdx
╭──────────────────────────────────────────────────────╮
│                                                      │
│   Storybook 7.0.0-rc.1 for react-vite started        │
│   127 ms for manager and 1.79 s for preview          │
│                                                      │
│    Local:            http://localhost:6006/          │
│    On your network:  http://192.168.178.102:6006/    │
│                                                      │
╰──────────────────────────────────────────────────────╯
```
D1no added a commit to D1no/reproduction-storybook-symlinks-pnpm that referenced this issue Mar 12, 2023
…upgrade --prerelease --skip-check`, fixes `rc.0` doctrine regression

storybookjs/storybook#21399
FIXES storybookjs/storybook#21523
FIXES storybookjs/storybook#21527

Console: 
```bash
➜  tools git:(master) ✗ pnpx storybook@next upgrade --prerelease --skip-check
.../Library/pnpm/store/v3/tmp/dlx-97337  | +603 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.../Library/pnpm/store/v3/tmp/dlx-97337  | Progress: resolved 624, reused 581, downloaded 22, added 603, done
 • Checking for latest versions of '@storybook/*' packagesinfo ,Using pnpm
info Upgrading /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/package.json
info 
info  @storybook/addon-essentials    ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/addon-interactions  ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/addon-links         ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/blocks              ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/react               ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  @storybook/react-vite          ^7.0.0-beta.63  →  ^7.0.0-rc.1
info  storybook                      ^7.0.0-beta.63  →  ^7.0.0-rc.1
info 
info Run pnpm install to install new versions.
info ,
info 
info ,Using pnpm
info Upgrading /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools/package.json
info 
info No dependencies.
info ,
 • Installing upgrades • Preparing to install dependencies. ✓


Packages: +809
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /Users/worker/Library/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 830, reused 781, downloaded 28, added 809, done

dependencies:
+ react 18.2.0
+ react-dom 18.2.0

devDependencies:
+ @storybook/addon-essentials 7.0.0-rc.1
+ @storybook/addon-interactions 7.0.0-rc.1
+ @storybook/addon-links 7.0.0-rc.1
+ @storybook/blocks 7.0.0-rc.1
+ @storybook/react 7.0.0-rc.1
+ @storybook/react-vite 7.0.0-rc.1
+ @storybook/testing-library 0.0.14-next.1
+ @types/react 18.0.28
+ @types/react-dom 18.0.11
+ prop-types 15.8.1
+ storybook 7.0.0-rc.1
+ typescript 4.9.5
+ vite 4.1.4

The integrity of 1217 files was checked. This might have caused installation to take longer.
Done in 16.2s
. ✓

attention => Storybook now collects completely anonymous telemetry regarding usage.
This information is used to shape Storybook's roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://storybook.js.org/telemetry

➜  tools git:(master) ✗ pnpm run storybook                                   

> tools@ storybook /Users/worker/development/_REPRODUCTIONS/reproduction-storybook-symlinks-pnpm/tools
> storybook dev -p 6006

@storybook/cli v7.0.0-rc.1

info => Starting manager..
WARN No story files found for the specified pattern: stories/**/*.mdx
╭──────────────────────────────────────────────────────╮
│                                                      │
│   Storybook 7.0.0-rc.1 for react-vite started        │
│   127 ms for manager and 1.79 s for preview          │
│                                                      │
│    Local:            http://localhost:6006/          │
│    On your network:  http://192.168.178.102:6006/    │
│                                                      │
╰──────────────────────────────────────────────────────╯
```
@D1no
Copy link

D1no commented Mar 12, 2023

Can be closed @shilman. Regression disappeared with 7.0.0-rc.1

@shilman shilman closed this as completed Mar 13, 2023
@github-project-automation github-project-automation bot moved this from Required for GA to Done in Core Team Projects Mar 13, 2023
@shilman
Copy link
Member

shilman commented Mar 17, 2023

Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-rc.4 containing PR #21535 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
6 participants