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]: TypeError: Cannot redefine property: default #23314

Closed
pedro3g opened this issue Jul 5, 2023 · 9 comments
Closed

[Bug]: TypeError: Cannot redefine property: default #23314

pedro3g opened this issue Jul 5, 2023 · 9 comments

Comments

@pedro3g
Copy link

pedro3g commented Jul 5, 2023

Describe the bug

I've been trying to configure the Storybook in Next.js for a few hours now. It turns out that when running "npm run storybook" and accessing it in the browser, I get an error message:
image

I created a repository containing the code that is generating error. It's just code generated by "create-next-app" and "nb init"
https://github.com/pedro3g/nextjs-storybook-issue

To Reproduce

https://github.com/pedro3g/nextjs-storybook-issue

System

Environment Info:

  System:
    OS: Linux 6.1 Manjaro Linux
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
  Binaries:
    Node: 20.3.1 - ~/.nvm/versions/node/v20.3.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v20.3.1/bin/yarn
    npm: 9.7.2 - ~/.nvm/versions/node/v20.3.1/bin/npm
  npmPackages:
    @storybook/addon-essentials: ^7.0.25 => 7.0.25 
    @storybook/addon-interactions: ^7.0.25 => 7.0.25 
    @storybook/addon-links: ^7.0.25 => 7.0.25 
    @storybook/blocks: ^7.0.25 => 7.0.25 
    @storybook/nextjs: ^7.0.25 => 7.0.25 
    @storybook/react: ^7.0.25 => 7.0.25 
    @storybook/testing-library: ^0.0.14-next.2 => 0.0.14-next.2

Additional context

No response

@pedro3g pedro3g changed the title [Bug]: [Bug]: TypeError: Cannot redefine property: default Jul 5, 2023
@JungHoonGhae
Copy link

this is exactly what I am getting right now.....

@roottool
Copy link
Contributor

roottool commented Jul 5, 2023

I am also experiencing this issue. I use Storybook latest version(7.0.25) and Next.js latest version(13.4.8).
But I don't reproduce it when I use Next.js v13.4.7.

@fqf
Copy link

fqf commented Jul 5, 2023

the same problem

@fqf
Copy link

fqf commented Jul 5, 2023

I am also experiencing this issue. I use Storybook latest version(7.0.25) and Next.js latest version(13.4.8). But I don't reproduce it when I use Next.js v13.4.7.

It really works for me. I downgrade next version and the problem has gone. Thank you.

@sookmax
Copy link
Contributor

sookmax commented Jul 5, 2023

Guys, this issue has been resolved with this pull request #23296. I'm not sure when this fix is going to be released, but you can follow up #23287, which is the same issue reported earlier.

@federicocappellotto97
Copy link

Same here. Upgraded next to 13.4.8 and storybook is not working anymore

@shilman
Copy link
Member

shilman commented Jul 5, 2023

Fixed in https://github.com/storybookjs/storybook/releases/tag/v7.0.26 and also in the latest beta

@Atralbus
Copy link

If you are still experiencing this issue on new versions, it may be related to the change you made in preview.ts file to unoptimize the image: #23561

@mbret
Copy link

mbret commented Jul 28, 2023

I still have the error on latest version and I never did any change to preview for unoptimizing images

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

No branches or pull requests

9 participants