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

mime type for .ico file is undefined #7083

Closed
7 tasks done
otakustay opened this issue Feb 25, 2022 · 6 comments · Fixed by #7106
Closed
7 tasks done

mime type for .ico file is undefined #7083

otakustay opened this issue Feb 25, 2022 · 6 comments · Fixed by #7106

Comments

@otakustay
Copy link
Contributor

otakustay commented Feb 25, 2022

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

@bluwy
Copy link
Member

bluwy commented Feb 25, 2022

Related lukeed/mrmime#3

@poyoho
Copy link
Member

poyoho commented Feb 26, 2022

image

emmm...

@otakustay
Copy link
Contributor Author

It's safe when either the file is large enough to be extract as a separate asset, or it is not an .ico file

@poyoho
Copy link
Member

poyoho commented Feb 26, 2022

None of the repos you provided have .ico file

@otakustay
Copy link
Contributor Author

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

@poyoho
Copy link
Member

poyoho commented Feb 26, 2022

yes I see :p

@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants