SyntaxError: Unexpected token '<' #133599
Replies: 3 comments
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Thanks for posting in the GitHub Community, @haothien1103 ! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Projects and Issues category is solely related to conversations around the GitHub products Issues and Projects. We’ve moved your post to our Programming Help 🧑💻 category, which is more appropriate for this type of discussion. Please review our guidelines about the Programming Help category for more information. |
Beta Was this translation helpful? Give feedback.
-
Hi, @haothien1103 I guess the issue might be that you're trying to serve the frontend JavaScript files (React app) as backend Node.js files, leading to the 1. Remove the
|
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Feature Area
Issues
Body
Hi guys, I'm encountering a problem with my create-react-app. The problem is that when I deployed this source on Vercel, it run completely fine. But when I deployed this on my company hosting using a 3rd party service provider, it return error "503 Service Unavailable. The server is temporarily busy, try again later!". I've checked the log and this is the problem:
<!doctype html><title>React App</title><script defer="defer" src="./static/js/main.43407a36.js"></script><script>const global={}</script><script type="text/babel" src="../src/index.js"></script>
^
SyntaxError: Unexpected token '<'
at internalCompileFunction (node:internal/vm:76:18)
at wrapSafe (node:internal/modules/cjs/loader:1283:20)
at Module._compile (node:internal/modules/cjs/loader:1328:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at startApplication (/usr/local/lsws/fcgi-bin/lsnode.js:48:15)
at Object. (/usr/local/lsws/fcgi-bin/lsnode.js:16:1)
components/MyApp.js:
public/index.html:
The Backend is definitely configured to serve the .html files because my partner used to deploy a react file once and it work fine but then got this error when I deployed.
You can see the source code here: https://github.com/thien1103/M00RI
Does anyone know exactly what is going on with my code? I'm rookie to this, so I will appreciate all the answers coming from you guys. Thanks for reading. Hope that anyone is encountering the same problem as I do will find a way to solve this.
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions