question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React.js for Apache server.

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Timercommented, Jan 19, 2018

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.

1reaction
Timercommented, Jan 19, 2018

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to deploy a React App on Apache web server
1) Go to your React project root folder and open package.json . 2) Add "homepage" attribute to package.json. if you want to provide...
Read more >
Deploying and Hosting a React App on Apache Server
You don't need a Node.js server to deploy and host a React app. Apache server, or even on your shared hosting, can run...
Read more >
Deploying Frontend Server Using Apache Webserver
Basic setup and dependency to run node/react/next servers. Let's name Node.js/React.js/Next.js servers as Applications Servers and Apache ...
Read more >
Deploy React Application using Apache | CodeMonk - Medium
Deploy React Application Using Apache · Install NodeJS and npm · Install Create React App and create sample app · Installing Apache Server...
Read more >
Deploy React app to apache server.
Deploy React app to apache server. Hola! This post is dedicated to the people like me who went through so many headaches when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found