Fonts are not loaded in IE11 with built app
See original GitHub issueIs this a bug report?
Yes
Did you try recovering your dependencies?
Yes
Which terms did you search for in User Guide?
fonts
Environment
Environment: OS: macOS High Sierra 10.13.4 Node: 8.9.4 Yarn: 1.6.0 npm: 5.6.0 Watchman: Not Found Xcode: Not Found Android Studio: Not Found
Packages: (wanted => installed) react: ^16.4.0 => 16.4.0 react-dom: ^16.4.0 => 16.4.0 react-scripts: 1.1.4 => 1.1.4
Steps to Reproduce
- Create a new project with
create-react-app
- Add a font in the
src/font
dir - Add the necessary CSS to use this font using
@font-face
inindex.css
like in this example:
@font-face {
font-family: 'OpenSans-Regular';
src: url('./fonts/OpenSans/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('./fonts/OpenSans/OpenSans-Regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
body {
margin: 0;
padding: 0;
font-family: 'OpenSans-Regular', sans-serif;
}
- Run
yarn start
and open http://localhost:3000 in Internet Explorer 11 (using a VM may be a nice idea) and check that your font is used for the text (this is the expected behavior). - Stop the process and run
yarn build
- Run the built page by running
serve -s build
- Open http://localhost:3000 with Chrome, Firefox, etc. You will see that the used font is OpenSans
- Now open the same URL with Internet Explorer 11.
Expected Behavior
IE11 should display the text with the OpenSans font when the project is built.
Actual Behavior
The OpenSans font is not downloaded and the text is shown as sans-serif.
IE 11 (see how the text is rendered):
Chrome:
Reproducible Demo
I created a repository to show the problem here: https://github.com/michaelperrin/create-react-app-font-problem. Steps to reproduce:
- Clone my demo repo:
git clone https://github.com/michaelperrin/create-react-app-font-problem.git
- Run the following commands:
yarn global add serve
yarn build
serve -s build
- Open http://localhost:3000 with Chrome, Firefox, etc. You will see that the used font is OpenSans
- Now open the same URL with Internet Explorer 11 (using a VM may be a nice idea).
A few notes:
- This is not due to the fact that you are running the project on localhost (I hosted it on a server and got the same problem).
- This is not due to font formats (IE11 does support EOT files).
- This happens with any font.
- This is not due to security parameters of IE11 (font download is enabled).
- I hope I didn’t miss something and that this is an actual bug 😉
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Icon fonts not loading in IE11 - Stack Overflow
Font downloads are disabled in IE, under Internet Options / Security / Custom Level / Font Downloads enable /disable. They might be disabled...
Read more >Fonts are not displayed correctly on Windows 10 Internet ...
Font are not displayed correctly for web application on IE 11. On any other browsers font are displayed fine.
Read more >Font icons are not loaded in IE11 / Edge running on Windows 10
With this feature enabled (or the policy applied) custom fonts, such as font icons will not be loaded regardless of the provider.
Read more >Cross Browser Compatibility of CSS Font Loading in Internet ...
CSS Font Loading is Not Supported on Internet Explorer 11. ... LT Browser - Next-gen browser to build, test & debug responsive mobile...
Read more >Custom font files are not loading in IE11 - SAP Community
This issue is because of group policy for font family in Windows 10 IE 11. It works properly if you run the app...
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
Well your team has to start fixing the bug, surely by closing the issue you are not addressing the problem
Sent from my Mobile
On Thu, 6 Dec 2018, 11:37 stale[bot] <notifications@github.com wrote:
Same problem as @raffaeu. Built version of create-react-app doesn’t show correct fonts in IE11. I also use Ant Design for styling. Adding meta tags doesn’t work for me.