storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.74k stars 9.33k forks source link

Build exited too early in Docker #17003

Open florian-milky opened 2 years ago

florian-milky commented 2 years ago

Describe the bug In our CI we build storybook in a docker container to deploy it later. Today, one of the builds exited too early, and some files were missing like iframe.html:

#18 117.8 info => Manager built (1.85 min)
#18 DONE 142.3s

Normally it logs more lines:

#18 111.1 info => Manager built (1.73 min)
#18 138.7 info => Preview built (2.2 min)
#18 140.8 info => Output directory: /usr/src/dist/storybook
#18 DONE 141.1s

To Reproduce Can't reproduce really, this is for the record

System Docker node:14-alpine

Additional context Re-launched the build without changing anything and it worked fine

alk-mandrianarijaona commented 2 years ago

Hi @florian-milky, do you mind sharing your Dockerfile or any information on how the build runs? I know Docker do some image optimisation and may skip some parts and reuse cache in some case.

florian-milky commented 2 years ago

There is a bunch of stuff there but the relevant part is:

# syntax=docker/dockerfile:1.2
FROM node:14-alpine AS builder
...
RUN npm run build:storybook

package.json

"build:storybook": "build-storybook -o ./dist/storybook -s ./public,.storybook/public --quiet",

Our docker is configured with cache but in that case it triggered the storybook build, something went wrong at the end (I supposed) and it just continued

alk-mandrianarijaona commented 2 years ago

I guess the --quiet swallows all errors, removing it (at least temporary) may help see the root cause

florian-milky commented 2 years ago

Hmm I thought about that but why is it even logging at all then? I'll look into it, thanks!

alk-mandrianarijaona commented 2 years ago

I believe it should log at least the important errors

stale[bot] commented 2 years ago

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!

mhulse commented 2 years ago

@florian-milky did you ever solve this? I think I am seeing the same thing. Removing --quite doesn't seem to reveal anything obvious (at least, to me).

When I build on my host/Mac, it works.

In the Docker container, it's only generating a few files.

mhulse commented 2 years ago

I think I got it solved by boosting my Docker’s memory/disk allocation:

Screen Shot 2022-01-17 at 11 44 37 AM

My computer’s specs:

image

👍

florian-milky commented 2 years ago

@florian-milky did you ever solve this?

It was a one-time thing for me. Felt like a glitch

florian-milky commented 2 years ago

Running into this issue again. Removing --quiet did not help. No error or warning is shown. It just stops after the manager has been built.

florian-milky commented 2 years ago

Updated to storybook 6.5.13 and it is gone again

florian-milky commented 2 years ago

I think this is the culprit: https://github.com/webpack-contrib/terser-webpack-plugin#parallel