Skip to content
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

SVG not correctly rendered after build #8850

Closed
6 of 7 tasks
makinghappen opened this issue Mar 30, 2023 · 4 comments
Closed
6 of 7 tasks

SVG not correctly rendered after build #8850

makinghappen opened this issue Mar 30, 2023 · 4 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@makinghappen
Copy link

makinghappen commented Mar 30, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

SVG image included into main page featurelist not correctly rendered after build

const FeatureList = [ { title: 'We believe in «future of work»', Svg: require('@site/static/img/dodao/Ill-cat-future.svg').default, description: ( <> Our goal is to bring “real-world-business” to blockchain to reduce recruiting- and service fees and providing transparency, immutability, scalability and accessibility. </> ), url: '/docs/intro' }, ]
Ill-cat-star
Ill-note

Reproducible demo

https://docs.dodao.dev

Steps to reproduce

  1. add Ill-cat-star.svg to HomepageFeatures/index.js
  2. npx docusaurus build
  3. see image not correctly rendered after build

Expected behavior

SVG must be rendered correctly

Actual behavior

probably because of the compression it is corrupted

Your environment

Self-service

  • I'd be willing to fix this bug myself.
@makinghappen makinghappen added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Mar 30, 2023
@slorber slorber added status: needs more information There is not enough information to take action on the issue. status: needs triage This issue has not been triaged by maintainers and removed status: needs triage This issue has not been triaged by maintainers labels Apr 5, 2023
@slorber
Copy link
Collaborator

slorber commented Apr 5, 2023

What does "rendered correctly" means?

Does it happen to all svgs or just one in particular.

Does it happen in the prod build or in dev too.


Show me a minimal repro where the code already has the SVG not rendering correctly.

Your repro does not even contain the SVG you reference here.

Module not found: Error: Can't resolve '@site/static/img/dodao/Ill-cat-future.svg' in '/home/devopsdao/dodao-docusaurus/src/components/HomepageFeatures'

https://stackblitz.com/~/github.com/devopsdao/dodao-docusaurus

@makinghappen
Copy link
Author

here is how it renders, see https://docs.dodao.dev

image
it both renders so in dev and prod builds.

@slorber have pushed the version published on https://docs.dodao.dev to the github repository.

@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Apr 6, 2023
@slorber
Copy link
Collaborator

slorber commented Apr 6, 2023

Great, so what's the problem exactly? Isn't this rendering as it should?

Show me your actual render vs expected render side by side and highlights the problem.

@Josh-Cena
Copy link
Collaborator

I believe it's a duplicate of #8297. @makinghappen please try #8297 (comment) and we can re-open if it turns out it's not a duplicate. You may also want to embed the SVG using an <img> tag instead: <img src="/img/dodao/Ill-cat-future.svg" alt="" />

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed status: needs more information There is not enough information to take action on the issue. labels Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants