React and NextJs net::ERR_ABORTED 404 (Not Found) - node.js

When creating a default react project or a default nextjs project I get 404's I've tried on different machines and there it worked without any issue, so I am wondering what is wrong with my mac's configuration.
What Id did:
Create a new nextjs project using "npx create-next-app"
Everything got installed correctly (I am using node v16.9.1, but had the same issue with 14.6.x)
when I now run: npm run dev in the newly created folder the server starts correctly on port 3000
when navigating to 0.0.0.0:3000 the page doesn't load and remains white however the console shows:
GET http://localhost:3000/_next/static/chunks/webpack.js?ts=1632035639230 net::ERR_ABORTED 404 (Not Found)
localhost/:1
GET http://localhost:3000/_next/static/chunks/main.js?ts=1632035639230 net::ERR_ABORTED 404 (Not Found)
localhost/:1
GET http://localhost:3000/_next/static/chunks/react-refresh.js?ts=1632035639230 net::ERR_ABORTED 404 (Not Found)
localhost/:1
GET http://localhost:3000/_next/static/chunks/pages/_app.js?ts=1632035639230 net::ERR_ABORTED 404 (Not Found)
localhost/:1
GET http://localhost:3000/_next/static/development/_buildManifest.js?ts=1632035639230 net::ERR_ABORTED 404 (Not Found)
localhost/:1
GET http://localhost:3000/_next/static/chunks/pages/index.js?ts=1632035639230 net::ERR_ABORTED 404 (Not Found)
localhost/:1
GET http://localhost:3000/_next/static/development/_ssgManifest.js?ts=1632035639230 net::ERR_ABORTED 404 (Not Found)
when trying a "naked" react app:
npx create-react-app react1
cd react1
npm starty
I get the following errors:
GET http://localhost:3001/%PUBLIC_URL%/manifest.json 400 (Bad Request)
manifest.json:1 Manifest: Line: 1, column: 1, Syntax error.
favicon.ico:1
GET http://localhost:3001/%PUBLIC_URL%/favicon.ico 400 (Bad Request)
The attempt to bind "/%PUBLIC_URL%/manifest.json" in the workspace failed as this URI is malformed.
Probably both are not related, just wanted to add it in case they are.

I faced a similar issue with an existing project when I cloned the git repository to a Windows machine. I got the same error messages on browser console after running the app. It took me hours to figure out the cause of the problem.
It was that the project folder had a special character. Lets say it was Hello%20World. Renaming the folder to Hello-World fixed the problem. The "%" character was causing that issue.

Related

How to find out why I get 500 error from Firebase on server but not on localhost

I try to run my first node application on my server from subdomain. It works perfectly on my PC but when I move it to the server, seems everything works, site loads with all js except Firebase.
I get the following errors in chrome:
/firebase/firestore net::ERR_ABORTED 500 (Internal Server Error)
/firebase/app net::ERR_ABORTED 500 (Internal Server Error)
The 2 lines of my my .js triggers the error:
import firebase from '/firebase/app';
import '/firebase/firestore';
Obviously it can mean millions different issues but I have no idea how to find any logs or anything what would tell me why this error triggered.
I tried to turn off/on https. I checked logs on server but found nothing just the same 500 error in access log. I tried but couldn't find any node specific log on the server. I tried to re-install firebase. After I tried to re-install node and everything and re-started from scratch.
I tried to copy the whole node_modules folder to the server from my PC but didn't help.
I would expect it to run just as on localhost or at least see some log about the error so I could fix it. The server is Linux VPS with plesk obsidian. The app is on a subdomain, the main domain has php website running.

I can't execute a website using blazor webassembly published on IIS

I created a project with Blazor Webassembly using SignalR (VS 2019 - .Net Core 3.1).
When I run it from the development environment it works correctly, but when I publish it to IIS (the server project) and I try to run it, it shows me the following message:
Loading...
An unhandled error has occurred. Reload 🗙
The messages in the console are:
Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)
blazor.webassembly.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)
app.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)
app.css:1
I was having the same issue and the same resolution resolved it for me!
What I did was browse to the website where I hosted it, went into developer mode of the browser (F12), hovered over the error and looked at the path!
In my index.html file I had in the and just needed to remove the forward slash and it started working just fine!

Unable to redirect the URL to another page in docker app

Summarize of my problem:
I have create a website using MERN stack and deployed to AWS using docker.
when I refresh the domain page i.e http://discussion.sramanujan.com/ ,it works fine.
When I directly try to access the discussion url http://discussion.sramanujan.com/discussion , I get "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"
Steps to repro the issue:
lauch the website http://discussion.sramanujan.com/
Refresh the browser [website should reload successfully]
Click on discussion button. [website url will change to http://discussion.sramanujan.com/discussion ]
Refresh the page.
Expected:
Page should load discussion page on refresh
Actual:
Got an error message as "Failed to load resource: the server responded with a status of 500 (Internal Server Error)".
Any idea as how to handle this issue?
More information:
1.host server port 80 is mapped to docker container port 3000.
2.Navigation through website is working fine.
/usr/src/api is my WORKDIR
Logs from server:(on refresh I get error 500)
you are also getting a 304 (Not modified) error on your website, try to enable javaScript, after that it should work

manifest.json 404 not found when trying to run server that's just established

I am getting started with a server, following steps from here.
When running server however, I am getting the error :
Failed to load resource: the server responded with a status of 404 (Not Found)
manifest.json:1 Manifest: Line: 1, column: 1, Unexpected token.
I have tried installing reinstalling server packages, renaming files, changing url, switching locations.

Angular 2 Routing with Amazon EC2 404 error

I am trying to get a deployment of a MEAN stack app using angular2 v1.0.0 beta.3 up and running. Everything is going well so far except this annoying routing issue that did NOT occur when I deployed to Heroku. However; this is my first experience deploying to ec2 using elastic beanstalk.
When I open up the route at the base route / the page loads as normal and I can use the app as if nothing is wrong. However, if I navigate to a subroute, in my case /client/issue/:id , the state loads, but if I reload the page I will get a 404 ERROR. In my server.js I have what I thought was a 404 catch app.get('*', loadIndex'), but this does not seem to be the case. I assume it is an issue with the way ec2 handles routing, but I am not sure.
EDIT
It might also be worth noting that I am only getting an error in my /var/log/nginx/error.log file and not the /var/log/nodejs/nodejs.log file.
From the error.log file:
2016/04/06 15:14:00 [error] 18952#0: *16 open() "/var/app/current/client/Issue/yes/57044092fe1924e77d9049ab" failed (2: No such file or directory), client: 172.31.4.202, server: , request: "GET /client/Issue/yes/57044092fe1924e77d9049ab HTTP/1.1",

Resources