Docusaurus: Fail to copy static image during build

Created on 25 May 2018  路  12Comments  路  Source: facebook/docusaurus

Is this a bug report?

yes

Have you read the Contributing Guidelines on issues?

yes

Environment

Docusaurus: 1.1.3
Node: 10.1

Steps to Reproduce

  1. Use the same favicon file for both headerIcon and favicon
grep favicon website/siteConfig.js
  headerIcon: 'img/favicon.png',
  favicon: 'img/favicon.png',
  1. Put the favicon file in the static directory
ls website/static/img
aws-icons   favicon     favicon.png
  1. Run the build: yarn build

  2. Check file presence in build directory

ls website/build/img
aws-icons    favicon     language.svg

Expected Behavior

The favicon.png should be there

Actual Behavior

Everything is copied except this file.

It was working on 1.0.15, the bug was introduced with 1.1 versions.

bug claimed

Most helpful comment

@endiliey yes will check, my apologies for the delay

All 12 comments

It will be useful if you can share the favicon image. It might be introduced due to this PR

I just ran yarn build on the Docusaurus site, and I see favicon.ico in my build. So I am curious if @ahmadalfy may be right on this.

What I am thinking of is that the file is an invalid image (like an icon using the png extension) and hence optipng fails to compress it and move it.

You might be right, here is the icon:

favicon

In addition, I think it has been edited with Preview on macOS.

Can you try to check the integrity of the image using this tool? I need to update the command line tools before running it (check this guide)

pngcheck -vt website/static/img/favicon.png File: website/static/img/favicon.png (15037 bytes) chunk IHDR at offset 0x0000c, length 13 174 x 202 image, 32-bit RGB+alpha, non-interlaced chunk gAMA at offset 0x00025, length 4: 0.45455 chunk cHRM at offset 0x00035, length 32 White x = 0.3127 y = 0.329, Red x = 0.64 y = 0.33 Green x = 0.3 y = 0.6, Blue x = 0.15 y = 0.06 chunk iTXt at offset 0x00061, length 523, keyword: XML:com.adobe.xmp uncompressed, no language tag no translated keyword, 502 bytes of UTF-8 text chunk IDAT at offset 0x00278, length 14385 zlib: deflated, 32K window, superfast compression chunk IEND at offset 0x03ab5, length 0 No errors detected in website/static/img/favicon.png (6 chunks, 89.3% compression).

@ahmadalfy are you working on this ?

@endiliey yes will check, my apologies for the delay

I've got the similar issue, while running build on Docker node jessie image, using yarn. There was a problem with imagemin can not build and, as a result the images won't converted (but silently. Probably in newer versions it is not silent anymore)

This has been happening on my local (although randomly) as well. I thought it was a local issue but today I confirmed that it is not. In fact, Docusaurus itself is experiencing this.

See
https://circleci.com/gh/facebook/Docusaurus/2847
https://circleci.com/gh/facebook/Docusaurus/2844
https://circleci.com/gh/facebook/Docusaurus/2846

jpegtran-promise

The build succeed but along the line there is an unhandled promise. Causing christopher-chedeau.jpg and ricky-vetter.jpg to be missing.

missing image

SSH-ing circleci build also confirmed the suspicion of missing image file

Wondering if you have an idea on this @ahmadalfy ?
Seems that https://github.com/imagemin/imagemin/issues/154 is related

cc @yangshun @JoelMarcey

Edit: See #887

Can we not through those errors in console?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MoogyG picture MoogyG  路  3Comments

sebqq picture sebqq  路  3Comments

nebrelbug picture nebrelbug  路  3Comments

microbouji picture microbouji  路  3Comments

NikitaIT picture NikitaIT  路  3Comments