Daniel Loureiro
Daniel Loureiro

Reputation: 5333

Bitbucket Pipeline doesn't show the full output of Yarn build

I have a bitbucket pipeline with a yarn build command. The problem is that the output always misses the last lines:

+ yarn build
yarn run v1.22.19
$ react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:

It is suppose to have more lines after File sizes after gzip:.

My bitbucket-pipelines.yml:

image: node:latest

pipelines:
  branches:
    staging:
      steps:
        - step:
          name: Build
          caches:
            - node
          script:
            - yarn install
            - yarn build

The biggest issue is when yarn build errors. Because I don't see the last lines, I can't tell why it failed. When this happens, I have to manually run yarn build on my local machine to see the full logs, which is not the best solution.

When I run the same yarn build command on my machine, I get the full logs:

❯ yarn build
yarn run v1.22.19
$ react-scripts build
Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  383.56 kB  build/static/js/main.a23388a2.js
  13.39 kB   build/static/css/main.06459f93.css
  1.79 kB    build/static/js/787.44808443.chunk.js

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment

Done in 19.59s.

I found that the output is truncated on many other commands, not just yarn build. I created a simple echo "Hello, World!" that is executed remotely on a server via atlassian/ssh-run, and the "Hello, World!" message was truncated.

Upvotes: 1

Views: 2065

Answers (1)

Daniel Loureiro
Daniel Loureiro

Reputation: 5333

Solution: refresh the page.

tl;dr; This is a three-year bug (and counting) on the BitBucket interface: https://jira.atlassian.com/browse/BCLOUD-18574

It seems their interface doesn't work properly getting the results in real-time, but the logs are properly saved and can be retrieved by reloading the page.

Upvotes: 5

Related Questions