Describe the bug
After upgrading from 5.1.0-alpha.39 to 5.1.0-beta.1, most of my stories are missing from the sidebar. There's also a JavaScript error in the console:
TypeError: Cannot read property 'slice' of undefined
at Object.<anonymous> (vendors~main.1802bec481c24205c53d.bundle.js:380134)
at Object../node_modules/readable-stream/lib/_stream_writable.js (vendors~main.1802bec481c24205c53d.bundle.js:380765)
at __webpack_require__ (runtime~main.1802bec481c24205c53d.bundle.js:787)
at fn (runtime~main.1802bec481c24205c53d.bundle.js:150)
at Object../node_modules/readable-stream/readable-browser.js (vendors~main.1802bec481c24205c53d.bundle.js:381034)
at __webpack_require__ (runtime~main.1802bec481c24205c53d.bundle.js:787)
at fn (runtime~main.1802bec481c24205c53d.bundle.js:150)
at Object../node_modules/stream-browserify/index.js (vendors~main.1802bec481c24205c53d.bundle.js:395418)
at __webpack_require__ (runtime~main.1802bec481c24205c53d.bundle.js:787)
at fn (runtime~main.1802bec481c24205c53d.bundle.js:150)
Here's the line in question (in Chrome devtools):
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
System:
Still an issue in 5.1.0-rc.2.
@kaiyoma I missed this one somehow. We'll try to get it figured out before the 5.1 release. Do you have a repro available?
@shilman No, not easily. We use Storybook in our project for our internally developed components.
I glanced again at the error in the Chrome debugger and if I set a breakpoint on the line I mentioned above, I see ReferenceError: process is not defined when I hover over process. Hope this helps.
rc3 behaving the same.
Thanks guys. Looks like it's due to this change: https://github.com/storybookjs/storybook/pull/6767
I'll put together a fix this weekend.
hmmm. Shall we remove the readable-stream dependency once for all ?
@libetl I don't understand the dependency and what it has to do with this bug. Can you elaborate?
I mean the readable-stream npm dependency, indirectly pulled from the crypto module (to calculate hashes) contains the line of code responsible for crashing (or degrading) the application.
If we find another solution for hashing values, we remove that dependency.
Do you have another solution ?
Attempted to fix this in https://github.com/storybookjs/storybook/pull/6946 which was released in https://github.com/storybookjs/storybook/releases/tag/v5.1.0-rc.4
@kaiyoma @djMax can you try it out and let me know if that worked?
Attempted to fix this in #6946 which was released in https://github.com/storybookjs/storybook/releases/tag/v5.1.0-rc.4
@kaiyoma @djMax can you try it out and let me know if that worked?
I had the same issue - v5.1.0-rc.4 resolves the issue for me - thanks!
@shilman Yup, fixed our issue too. Thanks!
Most helpful comment
@shilman Yup, fixed our issue too. Thanks!