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]: composeStories() create errors on Next.js #30245

Open
cdedreuille opened this issue Jan 10, 2025 · 0 comments
Open

[Bug]: composeStories() create errors on Next.js #30245

cdedreuille opened this issue Jan 10, 2025 · 0 comments

Comments

@cdedreuille
Copy link
Contributor

Describe the bug

I'm trying to get stories from /packages/canon but /website is isolated from the rest of the repo so I'm using relative paths to get stories. If you run the website on yarn dev and see the two pages I created you can see that on the client version using use client; the components appears correctly but I get an error in the terminal and a 500 error in the console.

This error doesn't seem to come from fetching the component as if you just console.log(composeStories) you'll see the same error.

Is there's something wrong in my setup? Or is this a bug on the function itself?

Thanks 🙏

Reproduction link

https://codesandbox.io/p/github/cdedreuille/nextjs-compose-stories/main

Reproduction steps

  1. Go to https://codesandbox.io/p/github/cdedreuille/nextjs-compose-stories/main
  2. It should install all dependencies
  3. You should then see a website with two links on :3000
  4. On the first link (client side) you should see 3 buttons but in the console you should see a 500 error.
  5. You should also see in the terminal an error looking like:
TypeError: Cannot read properties of null (reading '0')
    at __webpack_require__ (/project/workspace/website/.next/server/webpack-runtime.js:33:42)
    at __webpack_require__ (/project/workspace/website/.next/server/webpack-runtime.js:33:42)
    at __webpack_require__ (/project/workspace/website/.next/server/webpack-runtime.js:33:42)
    at __webpack_require__ (/project/workspace/website/.next/server/webpack-runtime.js:33:42)
    at eval (./app/test-client/page.tsx:7:74)
    at (ssr)/./app/test-client/page.tsx (/project/workspace/website/.next/server/app/test-client/page.js:184:1)
    at Object.__webpack_require__ [as require] (/project/workspace/website/.next/server/webpack-runtime.js:33:42)

System

System:
    OS: macOS 15.2
    CPU: (16) arm64 Apple M3 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    Yarn: 3.8.1 - ~/.nvm/versions/node/v20.18.0/bin/yarn <----- active
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
  Browsers:
    Chrome: 131.0.6778.265
    Safari: 18.2

Additional context

No response

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

2 participants