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.

No syntax highlighting after creating a production build with create-react-app

See original GitHub issue

Describe the bug Styles are not applied to the <code> in the production build that’s not the case when I’m using dev server.

To Reproduce Steps to reproduce the behavior:

  1. Use create-react-app to create project using typescript template (idk if template matters)
  2. Use any of the syntax highlighter
  3. Use npm start build
  4. See the error

Expected behavior Styles should be applied.

Screenshots In dev: image In Production: image

Desktop (please complete the following information):

  • OS: Linux
  • Browser Chrome
  • Version 83

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:10
  • Comments:24

github_iconTop GitHub Comments

11reactions
filipe-costacommented, Jun 30, 2020

Same issue happens while using Nextjs.

5reactions
alexandrecanutocommented, Jun 18, 2020

Same thing happens to me, it runs fine in dev / localhost, but as soon as I deploy it, it becomes one single block of text with the same syntax.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a React code editor and syntax highlighter from scratch
In this tutorial, we will create a React code editor and syntax highlighter so you can type in your code and see how...
Read more >
Why won't React production build run on the browser?
But when I build the application and try to access "index.html" file on the build folder, it doesn't work and I encounter with...
Read more >
How to fix build failures with `create-react-app` in production
The build script bootstrapped by create-react-app performs some validation of your code. When most of this validation fails, ...
Read more >
Optimizing Performance - React
Create React App ... This will create a production build of your app in the build/ folder of your project. Remember that this...
Read more >
Creating a Production Build - Create React App
npm run build creates a build directory with a production build of your app. Inside the build/static directory will be your JavaScript and ......
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