Closed tomjn closed 1 year ago
I attempted to run the storybook build using --inspect
on Node and tried to pause the debugger after storybook had hung to see where it had hung and VSCode failed to pause and give me any information
Also --loglevel
doesn't appear to have any influence on the output, neither --loglevel silly
or --loglevel verbose
changes the output.
It appears storybook has no recovery/troubleshooting/debugging step for this, and should have exited with an error code but has not. It took a cmd+c force quite or crashing the node process deliberatley to trigger an exit code
The closest I can get to useful debugging information so far is running the command with --inspect
and attaching the Chrome debugger, which crashes the Node process immediately with:
Do you a have a reproduction repo you can share? If not, can you create one? See how to create a repro. Thank you! 🙏
@shilman I think you've missed the point, I'm sure I could eventually find out the specific thing causing my specific problem, that would be great for me this one time, but useless to everybody else.
This is not a user support issue, this is a bug report.
This issue is not about me and my specific problem on my project, it's about you and storybook just "hanging" frozen..
I am reporting a bug in Storybooks error handling mechanism.
This is the issue:
I also cannot give you a reproduction repo because I do not know the cause of my problem, and I have no mechanisms, no debugging steps, no logs, no error reporting, nothing, absolutely nothing I can use to diagnose or debug this issue. That is the bug. Storybook should have printed the error, it does not, it does nothing, it just hangs with no explanation.
Also, if I trigger this deliberately in a reproduction repo, that will be useless to me because I already know what caused it (me), and nothing will get fixed on the storybook side
@tomjn I think you're the one who's missing the point. I have seen hundreds of different Storybooks with webpack errors that cause Storybook to crash WITH an error. I have yet to see a clean example of Storybook hanging like this without any errors. I don't doubt it's a bug in Storybook but please explain how I can debug the problem if I can't reproduce it myself?
That's the problem though, I do not know how to reproduce it without giving you access to a full confidential client repository, but my understanding is if I did and you helped, you'd find the problem, fix it for me and my project, then close the issue. It's incredibly frustrating precisely because there is so little information, getting what I've provided in this issue has already required me to sink days of developer time trying to dig into storybook code and trying different combinations.
Believe me, if I could give you a clean repo that reproduced this 100% of the time I would, but even on my own project it isn't 100% reproducible for unknown reasons, with the issue mysteriously vanishing when switching branches or updating packages, only to reappear with the same load out unexpectedly.
I've seen reports of this elsewhere, I will try to locate one of these with their PR's that fixed the issue causing the problem for them
My guess is that this is either a corner case bug in webpack itself or a corner case with Storybook's configuration of webpack. Given that you've seen this problem across both webpack 4/5, across multiple versions of Storybook, AND across multiple projects, it sounds like a highly annoying issue and I'd love to get to the bottom of it.
@shilman is there a way to make it output more than just the number of modules/dependencies and instead name them outright? If I had an idea of which story it was trying to build that would help towards debugging as well as letting me try to isolate a reproduction case
I found this issue which has the same situation, the poster found their problem in the end:
Noting that a colleague had tried and failed to reproduce the issue in the same repository under Node 16, using the same package lock file & code. I have yet to get past this issue and uncover any clues to reproducing the problem but my tests have all been on Node 14. Hoping this might give clues to reproducing the issue more reliably
@tomjn Sorry for the radio silence -- took some family time to celebrate the new year. I think you can output the webpack stats object using the --webpack-stats-json
command-line flag. I'm not sure everything that's in there, but it contains a bunch of webpack internals that could be useful in debugging
I am also running into an issue where it completely times out and crashes. None of my components will open, the opening introduction page works but I can't navigate to anything else. This started for me in the past couple days where it was working beforehand.
Storybook 6.4.9
with React 17.0.2
@CWSites no, that's a separate unrelated issue, if you were having this issue you would never have gotten to the point where it could load in the browser, and it would not have crashed.
This issue is for when a build is frozen with no error messages while building dependencies, and has to be manually stopped by user interaction, either via cmd+c in the terminal, or by killing the node process.
You should create a new issue, or find the relevant issue for this problem
I'm having a similar issue. start-storybook
hangs without an error message or a status update. Adding stats: "verbose"
to the webpack config and --loglevel silly
to the command doesn't change the output.
UPDATE
I know this issue is more generally around error reporting during build. However, in case someone else stumbles on this specific issue, I resolved it by doing the following:
.storybook/main.js
that wasn't needed (all addons, plugins, etc)..storybook/preview.js
babel-plugin-react-require
couldn't be found.babel-plugin-react-require
as a dep, restored preview.js
and reverted all my main.js
changes and the build started working.I managed to track this down to some SCSS code that was making webpack freeze. Unfortunately the output from storybook made it look like it was storybook itself that had frozen, and I couldn't extract the command storybook was using to reproduce it independently.
From the storybook end, I believe the solution is better signalling, so it's clear it's not storybook that has the problem, but the webpack build. Perhaps by stating it's going to start and then saying it's finished
This is just crazy! How can one make storybook dev
to display al console logs from the components when it builds?
This is just crazy! How can one make storybook dev to display al console logs from the components when it builds?
@jiri-thiemel-te I'd avoid the hyperbole as it's a big put off to potential contributors who might volunteer time to fix problems.
Actually in my case there was nothing to hide, webpack itself and sub-components had no output in this situation, so it was not storybook at fault. Granted it looked like storybook was hiding the error messages, but it turned out a webpack plugin was entering an infinite loop.
I'm going to close this as it's misleading, and only attracting people with unrelated issues causing confusion.
Describe the bug
When building the storybook, webpack shows the progress and can hang due to an error. However, there are no clues to what this error is and no handling of the error.
For example:
Here it will proceed incrementing the numbers until it reaches that point, then it never proceeds or exits. There are no error messages, no logs, no warnings. This happens across many versions of Storybook 6.x and has happened on both Webpack 5 and Webpack 4 over the span of many months. I've also heard this happen from friends who use independent unrelated stacks that also use Storybook, and they too are none the wiser.
Looking up debugging steps for this issue reveals people who accidentally fixed their webpack issue and storybook started working again, but no debugging steps, no error logs, no methods for diagnosing the issue.
To Reproduce
Unknown at this time, sometimes it will randomly happen to us in CI but not locally, and a rebuild will make it proceed without problems, only to happen again several hours/days later.
System
This has also happened on multiple Intel Macs, MacOS 11, Circle CI running an ubuntu image, an AWS build server, under Storybook 6.3, 6.2, etc.
Additional context
How do you debug this? I'm not interested in solving my specific case if it means I'm just as lost when another issue crops up in 6 months time and there's no debugging or troubleshooting steps.
Also, how do I use the webpack config dump if half the entries are like this:
dirxml: [Function: dirxml],