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
Seeing warnings about unsupported file type: undefined for SVG images #9715
Comments
Can you create 2 minimal runnable repros?
I doubt it's the upgrade that led this warning to appear, because the new release doesn't contain any code change related to this. My believe is that this warning has likely always been there, when you reference svgs in markdown content. I'd kindly ask you to invest time to qualify better this potential bug. |
Ah yes you are correct @slorber ! It was my clearing the build cache that caused the warnings to reappear. I'm still not clear why they are being thrown however? I believe the SVG files are valid? |
That's likely a bug related to using svg files using markdown image syntax. We should probably find a way to read the dimensions of local svg files to apply them to the Hmm apparently our lib "image-size" is supposed to handle svgs as well, so it's probably a bug in this library. https://github.com/image-size/image-size Can you provide a sample SVG?
|
OK yep https://gist.github.com/dabeeeenster/004e82c3e344707751f294c16d5ddf50 shows the error being thrown in that library - issue raised here. |
FWIW, I have the same issue with editable svg's saved with draw.io. For now my solution is to add a build step that is invoked before # finds all .svg files and passes them to xargs to paraellelize
# svgo-ing them in groups of 10 (this avoids paying nodejs JIT time for every file)
fd -e svg -0 | xargs -0 -P $(nproc) -n 10 svgo ─╯ |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
When running
npm run build
after upgrading to docusaurus3.1.0
I have started seeing the following WARNING errors in the console:You can find the images referenced here: https://github.com/Flagsmith/flagsmith/tree/main/docs/static/img e.g. https://github.com/Flagsmith/flagsmith/blob/main/docs/static/img/self-hosted-architecture.svg
These are optimised SVG images but they are valid and display fine in browsers.
Reproducible demo
Flagsmith/flagsmith#3246
Steps to reproduce
npm run build
Expected behavior
No warning should show as the images are valid
Actual behavior
Receive warnings
[WARNING] The image at "/Users/ben/flagsmith/flagsmith/docs/static/img/saas-architecture.svg" can't be read correctly. Please ensure it's a valid image.
Your environment
v20.9.0
Self-service
The text was updated successfully, but these errors were encountered: