Today We are Going To Solve You need to enable JavaScript to run this app in reactJS in reactjs. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.
Contents
How to Fix You need to enable JavaScript to run this app in reactJS Error?
- How to Fix You need to enable JavaScript to run this app in reactJS Error?
To Fix You need to enable JavaScript to run this app in reactJS Error just Add proxy inside the client package.json file. To solve this error permanently you have to just add proxy inside the client package.json file. 5000 is my port number. May you should have different. So just try this method:
"proxy": "http://localhost:5000"
- You need to enable JavaScript to run this app in reactJS
To Fix You need to enable JavaScript to run this app in reactJS Error just route must be appeared after all other routes. Here you have to make sure that the route must be appeared after all other routes. So just make sure by that and your error will be solved.
app.get("/*", function (req, res) { res.sendFile(path.resolve(__dirname, '../client/build', 'index.html')); })
Solution 1 : Add proxy inside the client package.json file
To solve this error permanently you have to just add proxy inside the client package.json file. 5000 is my port number. May you should have different. So just try this method:
"proxy": "http://localhost:5000"
Solution 2 : route must be appeared after all other routes
Here you have to make sure that the route must be appeared after all other routes. So just make sure by that and your error will be solved.
app.get("/*", function (req, res) {
res.sendFile(path.resolve(__dirname, '../client/build', 'index.html'));
})
Conclusion
So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.
Also Read This Solutions
- How to downgrade python version from 3.8 to 3.7
- How to create hyperlink in Discord, in an embed in general
- error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”
- npm ERR! missing script: start
- Access to XMLHttpRequest has been blocked by CORS policy Redirect is not allowed for a preflight request only one route