-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Build issue with yarn 2 when not in git or svn context #14042
Comments
I'm having the same Issue, cost me about a day to figure this out. As a Workaround, creating an empty .git directory inside the docker build seems to work:
|
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Note: If you run into this problem, you can create a folder named .svn in your project to trick storybook into using that to detect the project root. |
Actually there's a |
Describe the bug
I found that a local build of storybook worked fine, but the same thing refused to build in Docker. After much hair-pulling, I discovered that it did work if the compilation occurred in the context of a git repo. The .git directory was quite reasonably being excluded from the Docker image.
In
getProjectRoot()
, the root is found by looking for a .git, .svn or node_modules directory, with process.cwd() as as fallback. However, in a Docker environment, there will be no .git or .svn and in yarn 2, there is no node_modules. It appears yarn 2 is presenting the cwd as a zip file.This results in the following in the generated webpack:
With .git present, it's
To Reproduce
Build in yarn 2 after deleting or renaming .git
Expected behavior
Build is successful
System
Repeatable on Windows/Ubuntu on WSL/node:current-alpine Docker image
The text was updated successfully, but these errors were encountered: