No syntax highlighting after creating a production build with create-react-app
See original GitHub issueDescribe 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:
- Use
create-react-app
to create project usingtypescript
template (idk if template matters) - Use any of the syntax highlighter
- Use
npm start build
- See the error
Expected behavior Styles should be applied.
Screenshots
In dev:
In Production:
Desktop (please complete the following information):
- OS: Linux
- Browser Chrome
- Version 83
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:24
Top 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 >
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 Free
Top 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
Same issue happens while using Nextjs.
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.