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

Storybook won't run without public folder #13196

Closed
brycesnyder opened this issue Nov 20, 2020 · 11 comments
Closed

Storybook won't run without public folder #13196

brycesnyder opened this issue Nov 20, 2020 · 11 comments
Labels

Comments

@brycesnyder
Copy link

I did a fresh install of my local repo and now I am no longer able to run storybook. Everytime I attempt to run npm run storybook I get an error stating that there is no public folder?

Screen Shot 2020-11-20 at 5 41 56 PM

@brycesnyder
Copy link
Author

I attempted to use Yarn as well, getting the same issue..

@shilman shilman added cra Prioritize create-react-app compatibility needs reproduction question / support PN labels Nov 21, 2020
@shilman
Copy link
Member

shilman commented Nov 21, 2020

@brycesnyder Do you have a repro repo you can share?

@brycesnyder
Copy link
Author

@shilman unfortunately, internal / NDA stuff (McAfee is where I work) so I can't post any code

@brycesnyder
Copy link
Author

Here is the debug output, I looked but doesn't really have much help.

1 verbose cli [
1 verbose cli   '/Users/{USERNAME}/.nvm/versions/node/v14.15.1/bin/node',
1 verbose cli   '/Users/{USERNAME}/.nvm/versions/node/v14.15.1/bin/npm',
1 verbose cli   'run',
1 verbose cli   'storybook'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v14.15.1
4 verbose run-script [ 'prestorybook', 'storybook', 'poststorybook' ]
5 info lifecycle @mcafee/{PRODUCT}@1.4.11~prestorybook: @mcafee/{PRODUCT}@1.4.11
6 info lifecycle @mcafee/{PRODUCT}@1.4.11~storybook: @mcafee/{PRODUCT}@1.4.11
7 verbose lifecycle @mcafee/{PRODUCT}@1.4.11~storybook: unsafe-perm in lifecycle true
8 verbose lifecycle @mcafee/{PRODUCT}@1.4.11~storybook: PATH: /Users/{USERNAME}/.nvm/versions/node/v14.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/{USERNAME}/dev/{PRODUCT}/node_modules/.bin:/Users/{USERNAME}/.nvm/versions/node/v14.15.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
9 verbose lifecycle @mcafee/{PRODUCT}@1.4.11~storybook: CWD: /Users/{USERNAME}/dev/{PRODUCT}
10 silly lifecycle @mcafee/{PRODUCT}@1.4.11~storybook: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'cross-env NODE_ENV=development start-storybook -p 9009 -s public'
10 silly lifecycle ]
11 silly lifecycle @mcafee/{PRODUCT}@1.4.11~storybook: Returned: code: 255  signal: null
12 info lifecycle @mcafee/{PRODUCT}@1.4.11~storybook: Failed to exec storybook script
13 verbose stack Error: @mcafee/{PRODUCT}@1.4.11 storybook: `cross-env NODE_ENV=development start-storybook -p 9009 -s public`
13 verbose stack Exit status 255
13 verbose stack     at EventEmitter.<anonymous> (/Users/{USERNAME}/.nvm/versions/node/v14.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/Users/{USERNAME}/.nvm/versions/node/v14.15.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid @mcafee/{PRODUCT}@1.4.11
15 verbose cwd /Users/{USERNAME}/dev/{PRODUCT}
16 verbose Darwin 19.6.0
17 verbose argv "/Users/{USERNAME}/.nvm/versions/node/v14.15.1/bin/node" "/Users/{USERNAME}/.nvm/versions/node/v14.15.1/bin/npm" "run" "storybook"
18 verbose node v14.15.1
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 255
22 error @mcafee/{PRODUCT}@1.4.11 storybook: `cross-env NODE_ENV=development start-storybook -p 9009 -s public`
22 error Exit status 255
23 error Failed at the @mcafee/{PRODUCT}@1.4.11 storybook script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 255, true ]

@shilman
Copy link
Member

shilman commented Nov 21, 2020

Did you try removing node_modules and/or lockfiles and reinstalling?

@brycesnyder
Copy link
Author

Yes sir, I did a clean -fdx, then reinstall.. same thing too.. Literally has me stumped. I even shived npm and node off my machine, reinstalled etc.. Same issue.

@brycesnyder
Copy link
Author

brycesnyder commented Nov 23, 2020

So, after uninstalling nvm, node, npm, and yarn from my system and attempting to reinstall those to fix the issues (multiple times) I learnt of someone setting up our CI having the same error, requiring a public folder. We ended up creating the public folder in the dir mkdir public and then running the command yarn storybook and it worked. I'm not entirely sure why all of this stemmed specifically from not having a public folder??

Any thoughts? And, thankfully, this is documented here in case someone else runs into this issue...

@shilman
Copy link
Member

shilman commented Nov 23, 2020

cc @ghengeveld any help here? we recently updated the public folder logic here and it's related: https://github.com/storybookjs/storybook/blob/next/lib/core/src/server/dev-server.ts#L90

@shilman
Copy link
Member

shilman commented Nov 24, 2020

@brycesnyder Is this fixed in 6.1.5?

@brycesnyder
Copy link
Author

No sir, just so it's documented..

Screen Shot 2020-11-24 at 9 29 03 AM

@brycesnyder brycesnyder changed the title No public directory when running npm run storybook Storybook won't run without public folder Nov 24, 2020
@shilman
Copy link
Member

shilman commented Nov 25, 2020

Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.6 containing PR #13245 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants