Flutter web - the server responded with a status of 404 (Not Found), main.dart.js:1 - flutter

Flutter web project works smoothly when running directly into chrome from IDE, but after calling flutter build web, and hosting the built web app is not opening(only a blank page) and showing this error which is
Failed to load resource: the server responded with a status of 404 (Not Found)
main.dart.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1
Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('http://localhost:8080/') with script ('http://localhost:8080/flutter_service_worker.js'): A bad HTTP response code (404) was received when fetching the script.

Did you publish resources not /build/web but /web?

First of all don't publish /build/web just publish /web folder's resources.
If you are hosting it with github then goto index.html and then change
<base href="/">
to
<base href="/YourRepoName/">
This worked for me..

I'm using nginx locally on my laptop to "force" flutter to serve my page.
The simplest config that I needed:
server {
listen 8004;
server_name your-domain.local;
location / {
root /path/to/your/project/build/web;
try_files $uri /index.html;
}
}
That's enough, the page is working without any problems :)

Related

How do use ionic 6 with Auth0 ionic sample

I am using the https://github.com/auth0-samples/auth0-ionic-samples/tree/main/angular and following the examples in the readme file to to letter
Allowed Callback URLs:
com.auth0.samples://XXXX/capacitor/com.auth0.samples/callback, capacitor://localhost, http://localhost, http://localhost:4200
Allowed Logout URLs:
com.auth0.samples://XXXXX/capacitor/com.auth0.samples/callback, http://localhost:4200
Allowed Origins (CORS):
capacitor://localhost, http://localhost
Allowed Web Origins:
http://localhost:4200
And it worked twice and then all further testing I received this error
Failed to launch 'com.auth0.samples://dev-zhh5r4vf5zhgl2w4.us.auth0.com/capacitor/com.auth0.samples/callback?code=XXXXX&state=OGhsemEyWmF3MXlrOHkyVjRsanRhOVVKZ1dNZjdSb0swMlc3OWUtVnZYOA%3D%3D' because the scheme does not have a registered handler.
Has anyone else received this error and what was the fix?

Grafana server error on home page. ERR_ABORTED 404 (Not Found)

Hi all of sudden my grafana page stopped loading tried clear browser cache, different browser restarting service and Switching OAM server ( HA) nothing helped getting below in console logs:
Could this be due to corrupt DB? Please advise
GET https://10.200.110.230:9000/public/build/grafana..css?v net::ERR_ABORTED 404 (Not Found)
DevTools failed to load SourceMap: Could not load content for https://10.200.110.230:9000/public/build/grafana.dark.css.map: Certificate error: net::ERR_CERT_AUTHORITY_INVALID
DevTools failed to load SourceMap: Could not load content for https://10.200.110.230:9000/public/build/manifest.4f5454f867a0cc2fe8dd.js.map: Certificate error: net::ERR_CERT_AUTHORITY_INVALID
DevTools failed to load SourceMap: Could not load content for https://10.200.110.230:9000/public/build/vendor.4f5454f867a0cc2fe8dd.js.map: Certificate error: net::ERR_CERT_AUTHORITY_INVALID
DevTools failed to load SourceMap: Could not load content for https://10.200.110.230:9000/public/build/app.4f5454f867a0cc2fe8dd.js.map: Certificate error: net::ERR_CERT_AUTHORITY_INVALID
login:1 Autofocus processing was blocked because a document already has a focused element.
login:102 GET https://10.200.110.230:9000/public/build/grafana..css?v net::ERR_ABORTED 404 (Not Found)
DevTools failed to load SourceMap: Could not load content for https://10.200.110.230:9000/public/build/0.4f5454f867a0cc2fe8dd.js.map: Certificate error: net::ERR_CERT_AUTHORITY_INVALID

NEXTJS API routes not working in production mode, getting a 502 error

ISSUE
I am unable to fetch my API routes in production mode and receiving an error of
VM15:1 GET https://movies-words-ts-86xlkq6rp.vercel.app/api/movies/tt5052448/words 502
Uncaught (in promise) Error: Request failed with status code 502
at LYNF.e.exports (fcae4559c849ad3f0939b7cca63449d545e4627d.d32ee7ae9c5841de2d98.js:1)
at Rn+g.e.exports (fcae4559c849ad3f0939b7cca63449d545e4627d.d32ee7ae9c5841de2d98.js:1)
at XMLHttpRequest.p.onreadystatechange (fcae4559c849ad3f0939b7cca63449d545e4627d.d32ee7ae9c5841de2d98.js:1)
Though everything works perfectly fine in development mode.
File information
api page
next.config.js
code from where I am calling the route, dict.tsx

openui5 sdk test suite page fails with response error 404

Using either locally installed openui5-sdk-1.18.10 or here https://openui5.hana.ondemand.com/#resources/testsuite/welcome.html, when trying to access the testsuite, the response is HTTP Status 404 - Resource could not be found!
It seems the referenced link is currently invalid. Try the following instead:
SAPUI5:
https://sapui5.hana.ondemand.com/sdk/resources/testsuite
OpenUI5:
https://openui5.hana.ondemand.com/resources/testsuite

Eclipse 3.5.1 update error (HTTP 503)

I'm trying to update Eclipse 3.5.1 (on Gentoo Linux) from the Galileo Discovery Site and I get this error message:
Network connection problems encountered during search.
Unable to access "http://download.eclipse.org/releases/galileo".
Error accessing site stream. [Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]
Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
Error accessing site stream. [Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd]
Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
It seems the 503 error code is intended to stop software from constantly downloading this file from w3.org. But how do I persuade Eclipse to stop requesting it?
After several updates of Eclipse, the supporting software and libraries this now works.
The correct way to update from the Galileo site is via "Help/Install New Software" or "Help/Update".
The route via "Help/Software Updates/Find and Install/Search for new..." fails because the update-site format has changed.