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

react-example fails to upgrade to storybook 6.4.0 #99

Closed
IanVS opened this issue Sep 22, 2021 · 3 comments
Closed

react-example fails to upgrade to storybook 6.4.0 #99

IanVS opened this issue Sep 22, 2021 · 3 comments

Comments

@IanVS
Copy link
Member

IanVS commented Sep 22, 2021

It seems that the change to add the on-demand store has broken the vite builder with react. The build completes, but I see two runtime errors, one for MDX and the other for component stories.

In MDX stories:

Uncaught TypeError: storyById is not a function
    at DocsContainer (DocsContainer.js:40)
    at renderWithHooks (react-dom.development.js:14985)
    at mountIndeterminateComponent (react-dom.development.js:17811)
    at beginWork (react-dom.development.js:19049)
    at HTMLUnknownElement.callCallback2 (react-dom.development.js:3945)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
    at invokeGuardedCallback (react-dom.development.js:4056)
    at beginWork$1 (react-dom.development.js:23964)
    at performUnitOfWork (react-dom.development.js:22776)
    at workLoopSync (react-dom.development.js:22707)

And in normal react stories:

Error: Target container is not a DOM element.
    at Object.render (react-dom.development.js:26091)
    at render.js:62
    at new Promise (<anonymous>)
    at _callee$ (render.js:61)
    at tryCatch (runtime.js:63)
    at Generator.invoke [as _invoke] (runtime.js:294)
    at Generator.next (runtime.js:119)
    at asyncGeneratorStep (render.js:36)
    at _next (render.js:38)
    at render.js:38

I traced down the second one a little bit, and it is happening in app/react/src/client/preview/render.tsx in renderElement. My guess is that it's being called when it shouldn't be, but I don't know why.

To Reproduce:

cd packages/example-react in this repo, then run npx sb@next upgrade --prerelease and yarn storybook.

Note, this is without enabling feautres.storyStoreV7.

@tmeasday
Copy link
Member

Ok, the issue here is something in the yarn setup. There were still 6.3.3 versions of certain packages running in the bundle. When I ran the upgrade command in the other two example apps, all packages seemed to be at 6.4.0-beta.0 and the SB seemed to operate normally.

@IanVS
Copy link
Member Author

IanVS commented Sep 23, 2021

ooooo, good catch! We've struggled with the mono-repo hoisting / not hoisting mess before. Maybe it's indeed time to try out pnpm (there's even an open PR to do just that). Thanks for the help!

@IanVS IanVS changed the title Storybook-builder-vite breaks with storybook 6.4.0-alpha.35 and higher react-example fails to upgrade to storybook 6.4.0 Oct 11, 2021
@IanVS
Copy link
Member Author

IanVS commented Oct 23, 2021

#118 shows this can be done.

@IanVS IanVS closed this as completed Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants