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.

Fonts are not loaded in IE11 with built app

See original GitHub issue

Is 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

  1. Create a new project with create-react-app
  2. Add a font in the src/font dir
  3. Add the necessary CSS to use this font using @font-face in index.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;
}
  1. 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).
  2. Stop the process and run yarn build
  3. Run the built page by running serve -s build
  4. Open http://localhost:3000 with Chrome, Firefox, etc. You will see that the used font is OpenSans
  5. 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):

ie

Chrome: react_app_-_font_test

Reproducible Demo

I created a repository to show the problem here: https://github.com/michaelperrin/create-react-app-font-problem. Steps to reproduce:

  1. Clone my demo repo: git clone https://github.com/michaelperrin/create-react-app-font-problem.git
  2. Run the following commands:
 yarn global add serve
 yarn build
 serve -s build
  1. Open http://localhost:3000 with Chrome, Firefox, etc. You will see that the used font is OpenSans
  2. 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:open
  • Created 5 years ago
  • Reactions:7
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
raffaeucommented, Dec 6, 2018

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:

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/create-react-app/issues/4585#issuecomment-444826923, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPooOPaugslK7URdWSCQ_XFi5945xcUks5u2PNOgaJpZM4UemOW .

2reactions
nemanja-stojanovic-mqsoftrscommented, Nov 6, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

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