Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
Which terms did you search for in User Guide?
font, public_url
Environment
"react-scripts": "^2.0.1"
Steps to Reproduce
- Add font file with src
- Import this font file from a CSS file
- Import the CSS in your app (e.g. index.js)
- Create .env file and add it PUBLIC_URL=.
- Build and test
Expected Behavior
The font URL should be http://localhost:5000/static/media/Roboto-Regular.3e1af3ef.ttf
It was working perfectly with CRA v1.
Actual Behavior
The font URL is http://localhost:5000/static/css/static/media/Roboto-Regular.3e1af3ef.ttf
Reproducible Demo
I've created a repo to reproduce: https://github.com/sylvhama/cra2-font-bug
- git clone https://github.com/sylvhama/cra2-font-bug.git
- npm i
- npm run build
- serve -s build
- Open URL in browser, look at the console:
Failed to decode downloaded font: http://localhost:5000/static/css/static/media/Roboto-Regular.3e1af3ef.ttf
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
Which terms did you search for in User Guide?
font, public_url
Environment
"react-scripts": "^2.0.1"
Steps to Reproduce
Expected Behavior
The font URL should be
http://localhost:5000/static/media/Roboto-Regular.3e1af3ef.ttfIt was working perfectly with CRA v1.
Actual Behavior
The font URL is
http://localhost:5000/static/css/static/media/Roboto-Regular.3e1af3ef.ttfReproducible Demo
I've created a repo to reproduce: https://github.com/sylvhama/cra2-font-bug
Failed to decode downloaded font: http://localhost:5000/static/css/static/media/Roboto-Regular.3e1af3ef.ttf