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]: Adding Storybook to NextJS 14 app with typescript freezes the build step at linting and type checking #25764

Open
Amitmahato opened this issue Jan 25, 2024 · 3 comments

Comments

@Amitmahato
Copy link

Describe the bug

Following the official documentation here, I added Storybook to my existing NextJS project and after the storybook installation was completed, the storybook server started and worked fine. But the next thing when I try to build my project with npm run build which would in turn run next build, the build process gets stuck at Linting and checking validity of types forever.

Version Info:

"next": "14.0.1",
"storybook": "^7.6.10",
"typescript": "^5.2.2"

To Reproduce

No response

System

Storybook Environment Info:

  System:
    OS: macOS 14.3
    CPU: (8) arm64 Apple M2
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 19.8.1 - ~/.nvm/versions/node/v19.8.1/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v19.8.1/bin/npm <----- active
  Browsers:
    Chrome: 120.0.6099.234
    Safari: 17.3
  npmPackages:
    @storybook/addon-essentials: ^7.6.10 => 7.6.10 
    @storybook/addon-interactions: ^7.6.10 => 7.6.10 
    @storybook/addon-links: ^7.6.10 => 7.6.10 
    @storybook/addon-onboarding: ^1.0.11 => 1.0.11 
    @storybook/blocks: ^7.6.10 => 7.6.10 
    @storybook/nextjs: ^7.6.10 => 7.6.10 
    @storybook/react: ^7.6.10 => 7.6.10 
    @storybook/test: ^7.6.10 => 7.6.10 
    storybook: ^7.6.10 => 7.6.10

Additional context

No response

@shilman
Copy link
Member

shilman commented Jan 27, 2024

Do you a have a reproduction repo you can share? If not, can you create one? Go to https://storybook.new or see repro docs. Thank you! 🙏

@Amitmahato
Copy link
Author

Amitmahato commented Jan 28, 2024

Do you a have a reproduction repo you can share? If not, can you create one? Go to https://storybook.new or see repro docs. Thank you! 🙏

Since I wasn't able to reproduce this issue on a new NextJS project from scratch - reproduction repo, I tried setting up the storybook in my current project on top of the first commit and everything ran smoothly. Then I wanted to figure out after what change does it start to mess up. After multiple attempts of using git bisect, I was able to identify the issue to appeared after my project had ag-grid-community and ag-grid-react setup and then I added storybook or vice-versa (the order of setting up storybook and ag-grid could be changed to reproduce the issue).

But again, when I tried setting up both on the new reproduction repo, I still couldn't reproduce it. Not sure why it is happening in my main project but not in the reproduction repo.

@Amitmahato
Copy link
Author

Do you a have a reproduction repo you can share? If not, can you create one? Go to https://storybook.new or see repro docs. Thank you! 🙏

Since I wasn't able to reproduce this issue on a new NextJS project from scratch - reproduction repo, I tried setting up the storybook in my current project on top of the first commit and everything ran smoothly. Then I wanted to figure out after what change does it start to mess up. After multiple attempts of using git bisect, I was able to identify the issue to appeared after my project had ag-grid-community and ag-grid-react setup and then I added storybook or vice-versa (the order of setting up storybook and ag-grid could be changed to reproduce the issue).

But again, when I tried setting up both on the new reproduction repo, I still couldn't reproduce it. Not sure why it is happening in my main project but not in the reproduction repo.

Finally, I was able to reproduce the issue after adding moment to the reproduction repo and using it with ColDef from ag-grid-community. Even with this combination, if I don't setup storybook in the repo, the build/transpilation is successful. But just after adding storybook, the issue of build/transpilation getting stuck starts to resurface.

Here, is the link to the reproduction repo @shilman.

Thanks much!

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

3 participants