Skip to content

Fix buildwarnings #1200

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jaas666
Copy link

@jaas666 jaas666 commented Apr 4, 2025

This takes care of some of the warning saying svg files are unsupported during the build

Reference for solution: facebook/docusaurus#9715

Copy link

netlify bot commented Apr 4, 2025

Deploy Preview for oasisprotocol-docs ready!

Name Link
🔨 Latest commit 4c9a818
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-docs/deploys/67f010c2d84eae0008e16bed
😎 Deploy Preview https://deploy-preview-1200--oasisprotocol-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jaas666 jaas666 changed the title Fix linter warnings Fix buildwarnings Apr 4, 2025
Copy link
Member

@matevz matevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jaas666. I tested your PR with downgraded image-size to 1.0.2, but I'm getting a new warning when parsing the .png file now, which is not present in recent versions (>=1.1.0) of image-size:

TypeError: unsupported file type: undefined (file: /home/oa/docs/docs/build/images/opl/celer-e2e.png)
    at lookup (/home/oa/docs/node_modules/image-size/dist/index.js:42:11)
    at /home/oa/docs/node_modules/image-size/dist/index.js:108:64
[WARNING] The image at "/home/oa/docs/docs/build/images/opl/celer-e2e.png" can't be read correctly. Please ensure it's a valid image.
unsupported file type: undefined (file: /home/oa/docs/docs/build/images/opl/celer-e2e.png)

So pinning to an unmaintained version of image-size just to replace .svg warnings with the .png warning is not really fixing anything.

Comment on lines +69 to +70
"image-size": "~1.0.2"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"image-size": "~1.0.2"
}
"image-size": "~1.0.2",
"comment": "Workaround for https://github.com/facebook/docusaurus/issues/9715"
}

@matevz
Copy link
Member

matevz commented Apr 10, 2025

I'm closing this PR for now. Feel free to reopen it, if you manage to find a better workaround.

@matevz
Copy link
Member

matevz commented Apr 10, 2025

Doing further investigation https://github.com/oasisprotocol/docs/blob/41194582fd4d1a38f50982565d06d5672d41e491/docs/build/images/opl/celer-e2e.png is actually not a PNG-formatted image, so the warning was in fact legit. I prepared a fix in #1205.

Can you rebase the PR and incorporate the suggestion #1200 (comment). Then I'll merge your PR.

@matevz matevz reopened this Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants