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

Inconsistency between @storybook/core-server buildDev & buildStatic options resolution (regression) #14561

Closed
lihbr opened this issue Apr 12, 2021 · 6 comments
Assignees

Comments

@lihbr
Copy link
Contributor

lihbr commented Apr 12, 2021

Describe the bug
buildDev() and buildStatic() don't resolve the configDir option the same way.

Basically buildStatic() now ignore provided loadOptions.configDir option.

This leads to build failing when using buildStatic() with a custom configDir provided through the loadOptions object.

Possible commit responsible for the regression (didn't read anything about that option being deprecated): 9bb89b7#diff-1f7816632a730834f23b99d2d097729e56e2401e30691f72e8a52b1a38b0cedfL259-R237

To Reproduce
n/a

See Additional context below, sorry!

Expected behavior
buildDev() and buildStatic() should resolve the configDir directory consistently.

Screenshots
n/a

Code snippets
n/a

System

Environment Info:

  System:
    OS: Windows 10 10.0.19041
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  Binaries:
    Node: 14.15.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - C:\Program Files\nodejs\yarn.CMD
    npm: 6.14.9 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 89.0.4389.114
    Edge: Spartan (44.19041.423.0), Chromium (89.0.774.75)

Additional context
Basically encountered this issue when using @nuxtjs/storybook which uses a custom configDir (.nuxt-storybook/storybook) that is provided to both buildDev() and buildStatic() (see: @nuxtjs/storybook/src/index.ts#L11-L18). Everything works fine with the dev server but fails when building static due to the above error.

Cheers! Let me know if anything~ Happy to provide a PR if confirmed valid but had trouble understanding the contributing guide~

cc farnabaz

┆Issue is synchronized with this Asana task by Unito

@farnabaz
Copy link

This is also reported in nuxt-modules/storybook#259

@ndelangen
Copy link
Member

@lihbr I think your analysis is spot on!

https://github.com/storybookjs/storybook/blob/next/lib/core-server/src/build-static.ts#L110

Should be changed! If you are to open a PR, I'm sure we can get it merge today! 🙇

@lihbr
Copy link
Contributor Author

lihbr commented Apr 12, 2021

Awesome! Can you just please highlight me as to which source/target branch should I use? Contributing guide got me confused :/ Will try to hop on Discord~

@ndelangen
Copy link
Member

You should branch off (and target) The next branch

@shilman
Copy link
Member

shilman commented Apr 13, 2021

Zoinks!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.0-alpha.6 containing PR #14566 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

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

@shilman
Copy link
Member

shilman commented Apr 14, 2021

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

npx sb upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants