mime type for .ico file is undefined
See original GitHub issueDescribe 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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry it seems I failed to save, I have edited it to https://stackblitz.com/edit/vitejs-vite-7ogktc?file=index.html&terminal=dev
yes I see :p