storybookjs/vue-cli-plugin-storybook

Compatibility with Storybook 5.3.1

steven-prybylynskyi opened this issue · 6 comments

Please investigate the issue with the undefined package that leads to a failed compilation

* @storybook/undefined in ./.storybook/generated-entry.js

Duplicate issue in storybook repo: storybookjs/storybook#9400

Fixed by v1.1.0

@pksunkara The serve command works but the build one seems to still fail for me.

For me too.

I can confirm that build is failing.

● ⍴/storybooks/vue-cli-plugin-storybook/tmp master☭  → npm run storybook:build

> tmp@0.1.0 storybook:build /Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp
> vue-cli-service storybook:build -c config/storybook

info @storybook/vue v5.3.3
info 
info clean outputDir..
info => Copying prebuild dll's..
info => Building manager..
info => Loading manager config..
info => Loading presets
info => Compiling manager..
info => manager built (27 s)
info => Building preview..
info => Loading preview config..
info => Loading presets
info => Loading config/preview file in "config/storybook".
info => Adding stories defined in "config/storybook/main.js".
info => Using default Webpack setup.
info => Compiling preview..


 ERROR  Failed to compile with 1 errors                                                                                                                                12:48:56 PM

 error  in ./config/storybook/generated-entry.js

Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
ENOENT: no such file or directory, open '/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/config/storybook/generated-entry.js'
    at PoolWorker.fromErrorObj (/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/WorkerPool.js:262:12)
    at /Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/WorkerPool.js:204:29
    at mapSeries (/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/neo-async/async.js:3625:14)
    at PoolWorker.onWorkerMessage (/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/WorkerPool.js:170:35)
    at /Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/WorkerPool.js:152:14
    at Socket.onChunk (/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/readBuffer.js:36:9)
    at Socket.emit (events.js:200:13)
    at Socket.Readable.read (_stream_readable.js:491:10)
    at flow (_stream_readable.js:960:34)
    at emitReadable_ (_stream_readable.js:555:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:9)

 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/vue/config.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./config/storybook/generated-entry.js

ERR! => Failed to build the preview
ERR! ./config/storybook/generated-entry.js
ERR! Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
ERR! Thread Loader (Worker 0)
ERR! ENOENT: no such file or directory, open '/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/config/storybook/generated-entry.js'
ERR!     at PoolWorker.fromErrorObj (/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/WorkerPool.js:262:12)
ERR!     at /Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/WorkerPool.js:204:29
ERR!     at mapSeries (/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/neo-async/async.js:3625:14)
ERR!     at PoolWorker.onWorkerMessage (/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/WorkerPool.js:170:35)
ERR!     at /Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/WorkerPool.js:152:14
ERR!     at Socket.onChunk (/Users/pksunkara/Coding/storybooks/vue-cli-plugin-storybook/tmp/node_modules/thread-loader/dist/readBuffer.js:36:9)
ERR!     at Socket.emit (events.js:200:13)
ERR!     at Socket.Readable.read (_stream_readable.js:491:10)
ERR!     at flow (_stream_readable.js:960:34)
ERR!     at emitReadable_ (_stream_readable.js:555:3)
ERR!     at processTicksAndRejections (internal/process/task_queues.js:84:9)
ERR!  @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/vue/config.js ./node_modules/@storybook/addon-knobs/dist/preset/addDecorator.js ./config/storybook/generated-entry.js main[5]
(node:95111) UnhandledPromiseRejectionWarning: [object Object]
(node:95111) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:95111) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tmp@0.1.0 storybook:build: `vue-cli-service storybook:build -c config/storybook`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the tmp@0.1.0 storybook:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/pksunkara/.npm/_logs/2020-01-15T07_18_56_259Z-debug.log

@pksunkara This comes from the use of webpack-virtual-modules, which is part of the main.js implementation, new in 5.3:

https://github.com/storybookjs/storybook/blob/next/lib/core/src/server/preview/iframe-webpack.config.js#L52-L58

@ndelangen knows the details, but maybe that's enough to help get you unstuck?

Looks like thread-loader is having issue with the virtual-module-webpack-plugin. Should have realized with the error message, but I was at the end of a long debugging session. Thanks @shilman