React.js for Apache server.
See original GitHub issueI’m having problems when publishing the application on the server. I get this error message:
Uncaught SyntaxError: Unexpected token <
Here is an example(npx create-react-app my-app). I’m doing a project build(yarn build). Browsing through static server - all good( serve -s build)! Upload to the server - nothing works.
I found many questions on this subject, but they or was reduced to approximately such code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^.*$ / [L,QSA]
or treated with Express.
I have also installed nginx and has access only to the working folder. I’m looking for a solution .htaccess or the configuration of the build.
I understand that the path does not exist and all you need to do is to change them. But I’m looking for a way not to do after each release.
What am I doing wrong?
P.S.
I already asked a similar question, but it was closed before I could clarify.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
File names will always change each build.
If you’ve carefully read this section and still have a problem, please ask it on Stack Overflow. We’re sorry we can’t help more!