Storybook: Error: ENOENT: no such file or directory, stat '<Path to project>/node_modules/@storybook/core/dist/server/public/index.html'

Created on 22 Jun 2018  路  1Comment  路  Source: storybookjs/storybook

Bug or support request summary

I'm trying to use Storybook with the wait-on npm package: https://www.npmjs.com/package/wait-on
When I run the wait-on command I get the error:

Error: ENOENT: no such file or directory, stat '<path to my project>/node_modules/@storybook/core/dist/server/public/index.html'
    at Error (native)

And I don't even have or use the storybook/core package. Do you know why it is searching for this file?

These are the @storybook packages I'm using:

  • storybook/addon-actions: "^3.4.8",
  • storybook/addon-info: "^3.4.8",
  • storybook/addon-knobs: "^3.4.8",
  • storybook/addon-links: "^3.4.8",
  • storybook/react: "^3.4.8",

And after I installed storybook/core I still got the error. I also removed node_modules and ran yarn again with no luck.

Steps to reproduce

These are the commands I run to induce the issue:

"storybook": "start-storybook -p 6006",
"cypress:test": "wait-on http://localhost:6006 && cypress run",
"test": "concurrently 'npm run storybook' 'npm run cypress:test' "

I get the error if I run the test command or if I run first:

npm run storybook

And then:

npm run cypress:test

So basically by using the wait-on package, Storybook searches for this file:

/node_modules/@storybook/core/dist/server/public/index.html'

That indeed doesn't exists.

Affected platforms

  • Using "wait-on": "^2.1.0",
react compatibility with other tools question / support

Most helpful comment

According to the docs:

wait-on http://localhost:8000/foo && NEXT_CMD # wait for http 2XX HEAD

Using wait-on with the http:xxxx trys to access with a HEAD method to the server, which is not supported in storybook (there is only a get command implemented). I've tested it with http-get instead and it did work for me.

wait-on http-get://localhost:8000/foo && NEXT_CMD # wait for http 2XX GET

>All comments

According to the docs:

wait-on http://localhost:8000/foo && NEXT_CMD # wait for http 2XX HEAD

Using wait-on with the http:xxxx trys to access with a HEAD method to the server, which is not supported in storybook (there is only a get command implemented). I've tested it with http-get instead and it did work for me.

wait-on http-get://localhost:8000/foo && NEXT_CMD # wait for http 2XX GET

Was this page helpful?
0 / 5 - 0 ratings