storybook icon indicating copy to clipboard operation
storybook copied to clipboard

Build exited too early in Docker

Open florian-milky opened this issue 3 years ago • 10 comments

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

florian-milky avatar Dec 13 '21 14:12 florian-milky

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.

alk-mandrianarijaona avatar Dec 15 '21 15:12 alk-mandrianarijaona

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

florian-milky avatar Dec 15 '21 15:12 florian-milky

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

alk-mandrianarijaona avatar Dec 16 '21 09:12 alk-mandrianarijaona

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

florian-milky avatar Dec 16 '21 09:12 florian-milky

I believe it should log at least the important errors

alk-mandrianarijaona avatar Dec 16 '21 16:12 alk-mandrianarijaona

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!

stale[bot] avatar Jan 09 '22 03:01 stale[bot]

@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 avatar Jan 17 '22 11:01 mhulse

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

👍

mhulse avatar Jan 17 '22 20:01 mhulse

@florian-milky did you ever solve this?

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

florian-milky avatar Jan 18 '22 14:01 florian-milky

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 avatar Oct 21 '22 13:10 florian-milky

Updated to storybook 6.5.13 and it is gone again

florian-milky avatar Oct 24 '22 10:10 florian-milky

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

florian-milky avatar Nov 14 '22 11:11 florian-milky