2

I'm building a website using React with Bun, also Tailwind 4. (Don't think this matters, but anyway)

import logo1 from "./logo_stroke.svg";
import logo2 from './assets/logo_stroke.svg';

....

<img src={logo1} className="h-10 w-20" />
<img src={logo2} className="h-10 w-20" />

They are the exact same logo, but logo1 appears as the broken picture icon, while the other one displays correctly

According to git, there is a difference between the two files as shown. enter image description here

Can someone explain what happened? All I did was open the SVG with VSC in text format and hit cmd + s. Didn't even modify anything. But git detected it as a change, and the SVG started showing.

0

1 Answer 1

2

It is looks like VS Code removed UTF-8 BOM symbols.

About BOM: What's the difference between UTF-8 and UTF-8 with BOM?

You can open both files in any HEX editor (for example HxD offline, also exists online hex editors) and look at difference in first bytes.

The same issue discussed here: https://gitlab.com/gitlab-org/gitlab/-/issues/29631

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.