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

Invalid path resolution #102

Closed
Armaldio opened this issue Aug 24, 2020 · 17 comments · Fixed by #137
Closed

Invalid path resolution #102

Armaldio opened this issue Aug 24, 2020 · 17 comments · Fixed by #137
Labels
type: bug Something isn't working

Comments

@Armaldio
Copy link

I assume on Windows path are not resolved correctly

  • CLI
    image
  • Generated files
    image
    (backslashes are not escaped which cause the path to not be resolved correctly)

I also manually set srcDir inside the config file
image

Version

@nuxtjs/storybook: 2.1.0
nuxt: 2.14.3

Reproduction Link

https://codesandbox.io/s/cranky-cookies-y5if8?file=/src/components/test.stories.js

Note: This sandbox just show my architecture as the error seems related to the OS & path escaping and I assume sandbox runs on linux

Steps to reproduce

Run yarn nuxt storybook

What is Expected?

The app should compile

What is actually happening?

image

@Armaldio Armaldio added the type: bug Something isn't working label Aug 24, 2020
@farnabaz
Copy link
Collaborator

farnabaz commented Aug 24, 2020

I believe this fixed in #93.
@lihbr am I wrong?

New version (v2.2.0) will be out in a couple of days

@lihbr
Copy link

lihbr commented Aug 24, 2020

Yup that's this very one 🙂

@farnabaz
Copy link
Collaborator

It's not released yet, so 🙂 ?

Not yet, will release in 2.2.0 within a day

@farnabaz
Copy link
Collaborator

v2.2.0 is out :)

@AndrewBogdanovTSS
Copy link

It's still happening in 2.2.0. Please, reopen

@farnabaz
Copy link
Collaborator

farnabaz commented Sep 1, 2020

@AndrewBogdanovTSS Could you provide a reproduction project? I already tested Armaldio's project in 2.2.0 and it works as expected

@farnabaz farnabaz reopened this Sep 1, 2020
@lihbr
Copy link

lihbr commented Sep 1, 2020

Tested on my side with 2.2.0 and works as expected 🤔 are you sure you're experiencing the same issue as described above? Path should now be final normalized: https://github.com/nuxt-community/storybook/blob/master/src/index.ts#L180

@AndrewBogdanovTSS
Copy link

I can't replicate this issue on the clean nuxt instance. But locally I get this error:

ERROR in ./.nuxt-storybook/storybook/storybook-init-framework-entry.js
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
ENOENT: no such file or directory, open 'H:\Projects\Wonder\frontend\.nuxt-storybook\storybook\storybo
ok-init-framework-entry.js'
    at PoolWorker.fromErrorObj (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool
.js:262:12)
    at H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool.js:204:29
    at mapSeries (H:\Projects\Wonder\frontend\node_modules\neo-async\async.js:3625:14)
    at PoolWorker.onWorkerMessage (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerP
ool.js:170:35)
    at H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool.js:152:14
    at Socket.onChunk (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\readBuffer.js:36:9)
    at Socket.emit (events.js:314:20)
    at Socket.EventEmitter.emit (domain.js:486:12)
    at Socket.Readable.read (_stream_readable.js:514:10)
    at Socket.read (net.js:625:39)
    at flow (_stream_readable.js:987:34)
    at emitReadable_ (_stream_readable.js:578:3)
    at processTicksAndRejections (internal/process/task_queues.js:79:21)
 @ multi ./.nuxt-storybook/client.js ./node_modules/@storybook/core/dist/server/common/polyfills.js ./
node_modules/@storybook/core/dist/server/preview/globals.js ./.nuxt-storybook/storybook/storybook-init
-framework-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-othe
r-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./.
nuxt-storybook/storybook/preview.js-generated-config-entry.js ./.nuxt-storybook/storybook/generated-st
ories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined main[3]

ERROR in ./.nuxt-storybook/storybook/preview.js-generated-config-entry.js
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 1)
ENOENT: no such file or directory, open 'H:\Projects\Wonder\frontend\.nuxt-storybook\storybook\preview
.js-generated-config-entry.js'
    at PoolWorker.fromErrorObj (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool
.js:262:12)
    at H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool.js:204:29
    at mapSeries (H:\Projects\Wonder\frontend\node_modules\neo-async\async.js:3625:14)
    at PoolWorker.onWorkerMessage (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerP
ool.js:170:35)
    at H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool.js:152:14
    at Socket.onChunk (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\readBuffer.js:36:9)
    at Socket.emit (events.js:314:20)
    at Socket.EventEmitter.emit (domain.js:486:12)
    at Socket.Readable.read (_stream_readable.js:514:10)
    at Socket.read (net.js:625:39)
    at flow (_stream_readable.js:987:34)
    at emitReadable_ (_stream_readable.js:578:3)
    at processTicksAndRejections (internal/process/task_queues.js:79:21)
 @ multi ./.nuxt-storybook/client.js ./node_modules/@storybook/core/dist/server/common/polyfills.js ./
node_modules/@storybook/core/dist/server/preview/globals.js ./.nuxt-storybook/storybook/storybook-init
-framework-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-othe
r-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./.
nuxt-storybook/storybook/preview.js-generated-config-entry.js ./.nuxt-storybook/storybook/generated-st
ories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined main[6]

ERROR in ./.nuxt-storybook/storybook/generated-stories-entry.js
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 2)
ENOENT: no such file or directory, open 'H:\Projects\Wonder\frontend\.nuxt-storybook\storybook\generat
ed-stories-entry.js'
    at PoolWorker.fromErrorObj (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool
.js:262:12)
    at H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool.js:204:29
    at mapSeries (H:\Projects\Wonder\frontend\node_modules\neo-async\async.js:3625:14)
    at PoolWorker.onWorkerMessage (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerP
ool.js:170:35)
    at H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\WorkerPool.js:152:14
    at Socket.onChunk (H:\Projects\Wonder\frontend\node_modules\thread-loader\dist\readBuffer.js:36:9)
    at Socket.emit (events.js:314:20)
    at Socket.EventEmitter.emit (domain.js:486:12)
    at Socket.Readable.read (_stream_readable.js:514:10)
    at Socket.read (net.js:625:39)
    at flow (_stream_readable.js:987:34)
    at emitReadable_ (_stream_readable.js:578:3)
    at processTicksAndRejections (internal/process/task_queues.js:79:21)
 @ multi ./.nuxt-storybook/client.js ./node_modules/@storybook/core/dist/server/common/polyfills.js ./
node_modules/@storybook/core/dist/server/preview/globals.js ./.nuxt-storybook/storybook/storybook-init
-framework-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-othe
r-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./.
nuxt-storybook/storybook/preview.js-generated-config-entry.js ./.nuxt-storybook/storybook/generated-st
ories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined main[7]

It might not be related to this specific problem with path though...so maybe a new issue should be created

@lihbr
Copy link

lihbr commented Sep 1, 2020

Indeed it doesn't look like the same issue, it'll be awesome if you can open another issue providing these logs & your Nuxt config 🙂

@AndrewBogdanovTSS
Copy link

@lihbr yeah, will try to replicate this it in the codesandbox later today. Just found out that its OS independent

@farnabaz
Copy link
Collaborator

@AndrewBogdanovTSS any news on this?

@adamskeeled
Copy link

Any updates on this? Also happening to me

@lihbr
Copy link

lihbr commented Oct 7, 2020

Have you tried to delete your package-lock.json or yarn.lock and then install everything again? I had some odd issues like the above few times and this helped because Storybook installs a lot of stuff which can lead to the package manager messing up sometimes 🤔

@adamskeeled
Copy link

I think I found the issue. On a clean nuxt project I installed the storybook module, and after a few tests, found out that having the build option parallel: true causes this issue of no such file or directory /path/to/project/.nuxt-storybook\storybook\storybo ok-init-framework-entry.js

@lihbr
Copy link

lihbr commented Oct 7, 2020

Nice catch 🤔 @farnabaz might be interested in investigating it more or perhaps already have an idea about it ☺️

@farnabaz
Copy link
Collaborator

farnabaz commented Oct 7, 2020

There is an unresolved issue in Storybook about using thread-loader. I guest our best solution for now is to disable parallel for storybook build.

@AndrewBogdanovTSS
Copy link

Sorry for the late reply. Once I've upgraded to v.3.0.0 the error is gone even when using parallel option. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants