You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've had this problem for a very long time. I suspect because McAfee Solidifier (unfortunately) is running on our work PCs and aggressively checks files as they are created (preventing write locks). Basically filesystem writes in the cache folder can randomly fail with "OPEN" errors. And by randomly, I mean about every 1-5 times I save a file in our project.
We previously got around this in Storybook 6 by disabling caching through webpack configuration. But there is no way in Storybook 8 to disable the core/src/common/utils/file-cache.ts, which is causing the storybook server to constantly and frequently crash.
I have looked through the codebase, and honesly I am very disappointed at how little thought has gone into filesystem access. You should be treating your filesystem reads and writes like they can fail 20% of the time, and properly handle these error scenarios. Even if 20% is unrealistic, the purpose is to harden your program so you're not running into random filesystem bugs. Especially for something like caching which is not mission critical for the software to run.
Here are some examples I found of unchecked filesystem writes. The errors aren't caught and handled, and usually any sort of write error causes a crash.
Thank you for opening the issue and for the analysis.
Please feel free to pick up the work and contribute a PR, since the solution seems to be pretty straightforward. I am happy to assist at any time if questions arise.
Describe the bug
We've had this problem for a very long time. I suspect because McAfee Solidifier (unfortunately) is running on our work PCs and aggressively checks files as they are created (preventing write locks). Basically filesystem writes in the cache folder can randomly fail with "OPEN" errors. And by randomly, I mean about every 1-5 times I save a file in our project.
We previously got around this in Storybook 6 by disabling caching through webpack configuration. But there is no way in Storybook 8 to disable the
core/src/common/utils/file-cache.ts
, which is causing the storybook server to constantly and frequently crash.I have looked through the codebase, and honesly I am very disappointed at how little thought has gone into filesystem access. You should be treating your filesystem reads and writes like they can fail 20% of the time, and properly handle these error scenarios. Even if 20% is unrealistic, the purpose is to harden your program so you're not running into random filesystem bugs. Especially for something like caching which is not mission critical for the software to run.
Here are some examples I found of unchecked filesystem writes. The errors aren't caught and handled, and usually any sort of write error causes a crash.
storybook/code/core/src/common/utils/file-cache.ts
Line 97 in f2af173
storybook/code/core/src/common/utils/file-cache.ts
Line 89 in f2af173
storybook/code/core/src/builder-manager/utils/files.ts
Line 23 in f2af173
storybook/code/core/src/csf-tools/ConfigFile.ts
Line 971 in f2af173
storybook/code/builders/builder-vite/src/plugins/external-globals-plugin.ts
Line 67 in f2af173
storybook/code/lib/create-storybook/src/generators/configure.ts
Line 114 in f2af173
You call this project the industry standard, please write your code so that it lives up to this title.
Reproduction link
https://stackblitz.com/github/storybookjs/sandboxes/tree/next/vue3-vite/default-ts/after-storybook?file=README.md&preset=node
Reproduction steps
System
Additional context
No response
The text was updated successfully, but these errors were encountered: