I'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.
Unfortunately, we're not experts in Apache beyond the recommendation in our deployment guide.
This question is better suited for Stack Overflow.
From your error, however, it appears you're serving index.html for JavaScript requests.
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.
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!
Thank you! The home page parameter helped.
Excellent 馃槃
Most helpful comment
File names will always change each build.