This can be reproduced with the example in sample/v2.
- Upgrade to react-scripts 5.0.1
- npm install && npm start
- Inspect the env.js request with the network tab - response will be a chunk of HTML, causing error message in the console.
Possible solution:
- Placing an empty
public/env.js avoids the problem.