question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mime type for .ico file is undefined

See original GitHub issue

Describe the bug

mrmime doesn’t support mime type lookup for .ico files, it returns undefined.

Run vite build && cat dist/index.html in reproduction, we can see a data:undefined/base64, string.

Given that .ico is a widely used format for favicons, how about we hard coding a mime type for it in fileToBuiltUrl function?

Reproduction

https://stackblitz.com/edit/vitejs-vite-7ogktc?file=index.html&terminal=dev

System Info

System:
    OS: macOS 12.1
    CPU: (8) arm64 Apple M1
    Memory: 86.78 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - /var/folders/9v/sx18bwn925b3f2rp2jfg952w0000gn/T/fnm_multishells/81962_1645781288344/bin/node
    Yarn: 1.22.15 - /var/folders/9v/sx18bwn925b3f2rp2jfg952w0000gn/T/fnm_multishells/81962_1645781288344/bin/yarn
    npm: 8.3.0 - /var/folders/9v/sx18bwn925b3f2rp2jfg952w0000gn/T/fnm_multishells/81962_1645781288344/bin/npm
  Browsers:
    Chrome: 98.0.4758.109
    Safari: 15.2
  npmPackages:
    @vitejs/plugin-react: ^1.0.7 => 1.2.0
    vite: ^2.8.0 => 2.8.4

Used Package Manager

yarn

Logs

No response

Validations

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
otakustaycommented, Feb 26, 2022

Sorry it seems I failed to save, I have edited it to https://stackblitz.com/edit/vitejs-vite-7ogktc?file=index.html&terminal=dev

0reactions
poyohocommented, Feb 26, 2022

yes I see :p

Read more comments on GitHub >

github_iconTop Results From Across the Web

Correct MIME Type for favicon.ico? - Stack Overflow
While the IANA-registered MIME type for ICO files is image/vnd.microsoft.icon, it was submitted to IANA in 2003 by a third party and is...
Read more >
Correct MIME Type for favicon.ico? - SyntaxFix
According to the Internet Assigned Numbers Authority (IANA), all .ico file falls under the MIME type image/vnd.microsoft.icon . (Source).
Read more >
.ico support · Issue #3 · lukeed/mrmime · GitHub
It'd be great if .ico was support out of the box. Thankfully you expose the mimes table, ... mime type for .ico file...
Read more >
Solved: MIME type for Favicon and HTML syntax | Experts Exchange
I've double checked that the MIME type is set up on the IIS server. It is set to "image/x-icon". I've verified my syntax...
Read more >
ZIP file MIME type is not recognized - Bugzilla@Mozilla
If i select a ZIP file, then it's File Type (MIME type) is not recognized: ... If I select any other file such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found