http://www.sakshum.org/sakshumwebgae/8CB611AC7A0B5B6BE2C4C99A8EA4DEFE.cache.html not found - google-app-engine

on our gae for java app using gwt on loading the app and checking in firebug i see error http://www.sakshum.org/sakshumwebgae/8CB611AC7A0B5B6BE2C4C99A8EA4DEFE.cache.html as a result gwt modules seems to be not getting loaded.
I am assuming this file should be auto generated by gae. so why i m facing it and what can be done to solve it?

Your asumption is wrong. That file is generated by the GWT compilation (at the same time the sakshumwebgae/sakshumwebgae.nocache.js is generated) and should be deployed within your app.

Related

Angular - Failed to load module script:

I have angular 8 front end application in production and its Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
This issue is happening only in production build that too not always , able reproduce only sometimes.
main-es2015.fcc7123d15fd9c113b00.js:1
vendor-es2015.d8d7d81cc2b06ece8c91.js:1
How do i fix it.?
Are you using serviceWorker?
If so you have to add inside angular.json "serviceWorker": true for the configuration that you are using.
I would like to share my experience with the same issue I was facing in the organization where I'm working.
I had an Angular 9 application and when I deployed to Stage environment, I got three errors in my console which showed as "module not loaded due to Mime type". This was working fine in all other environment and after much struggle, it was found that the files under the website were not having access. E.g. When you deploy an Angular application, you will get index.html file and many other js files. The website had permission issues. The site was hosted in the Rackspace and the FireWall was not configured to have access to the files right under the website.
Once the below access was provided, the app started working.
/assets*
/*.css
/*.js
/*.ico
/*.html
The only difference I see with your problem is that you have mentioned it is working sometimes.
There is another post Blocked because of a disallowed MIME type (“text/html”) : Angular 8 deployed on tomcat 9.0.30 fails to serve the assets try the solution based on base reference as those js files are not served/loaded
I hope this might help someone.

Error while deploying react based SSR app, using firebase-functions

I am trying to deploy my SSR app in Firebase originally forked from, after doing some modification in the app.
Which works fine when I do sudo firebase serve --only functions,hosting but throwing error when I do firebase deploy.
The reproducible repo has a package.json.
I am using the public directory as my function directory as well.
However, even if I am using a different function directory for my cloud functions, I see the same errors.
Function failed on loading user code. Error message:
Code in file index.js can't be loaded. Is there a syntax error in your code?
Detailed stack trace: TypeError: c(...) is not a function
at Object.<anonymous> (/user_code/assets/app.server.js:1:28950)
at Object.module.exports.n (/user_code/assets/app.server.js:1:29283)
...
Functions deploy had errors.
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
It is possible, but you cannot serve static assets with cloud functions. You need a mix of firebase functions and firebase hosting.
The guys at Firebase already thought on this and you also have an implementation available.
Check the following documentation:
Overview
Dynamic Content
Code Example
Youtube Video
Note: There is a delay that you need to take into consideration when using cloud functions.
When a new instance handles its first request, the response time suffers, which is called a cold start
More info
The problem is that firebase hosting only supports SPAs, which means that SSR is out of the picture, you need to run your SSR server in a different env where you can run nextJS, or if you're using a static page generator you could upload the files directly compromising on the ability to refresh the content, although, I'm sure a solution with cloud functions and gatsby is feasable.
Tl;DR: You won't get SSR out of Firebase Hosting

service worker canceling out REST urls

just started working with reactjs recently, month or two..not a pro but can find my way around.. I am using create ract app (quickie ,that ships with service-worker) and my setup is such that I am deploying react app in the root of my java REST application, so all my service rest calls are in relative format, e.g /rest/myservice/123 etc.. and they work just fine..
but recently I started getting strange errors, and rest calls stopped working..
if I execute RET URL from browser .... nothing happens index loads... when I test with postman REST works just fine it also works in safari or if url is localhost... ...so after hours of frustration i discovered that service worker doing its .... caching . my rest calls are getting intercepted and they never make it to server... and there is nowhere that it mentions about how to overcome it, neither in service worker docs nor in create-react-app docs ...nothing is mentioned about this use case...... this is so pathetic...
I figured it out after numerous trail and errors... but it did not stop there..
I went ahead and deleted the service-worker registration entry from index.js also deleted service-worker file and rebuild the app. well service-worker.js file is still there... it showed up in build folder after I rebuild the project..... what is it with create-react-app did they got paid by google to include service-worker? or what is going on? why can not I remove it? and how do I prevent it from canceling my rest url calls?
when I type : https://xxxx.io/x/referal/refCode/3429878 it just loads application...
what else am I missing?
got the answer over #Redit needed to unregister worker...
details #:
https://www.reddit.com/r/reactjs/comments/8hovvb/removal_of_serviceworker_from_reactjs_app/

unable to use JSP files in google app engine

Sample application works , unable to proceed with creating modifications to project
JDK included in build path (some posts say that lack of that might cause errors)
Error -> Error 403 in web page nothing else printed in console or web page
when I do localhost:8888/test.jsp I get a 404 error
console:
This works ->
<welcome-file>NewFile.html</welcome-file>
This FAILS ->
<welcome-file>guestbook.jsp</welcome-file>
my project directory from eclipse
where am i going wrong or missing something
it looked under WAR but it was not under WAR . some internal problem in my eclipse . now fixed
OLD
NEW

NetworkError: 404 Not Found on firefox

We have a gwt app deployed on gae for java. The app runs fine in google chrome but fails with below exception on ie and firefox
NetworkError: 404 Not Found - http://www.sakshum.org/adminmodule/67883654A8944A4C561CF25763FB1D79.cache.html
based on Setup a GWT Project correctly with SVN and Eclipse we have excluded the files in adminmodule directory to upload to app engine.
Please advise what is reason for it to fail and how to make it working.
The ignored patterns are:
.svn
*.bak
classes/
thumbs.db
*.class
.gwt*
gwt-unitCache/
deploy/
war/adminmodule/
war/sakshumwebgae/
sakshumweb/war/WEB-INF/deploy/adminmodule/
sakshumweb/war/sakshumwebgae/
.bin
*.orig
You will get 404. HORROR!!!!
Currently only /deploy/ folder can be ignored and not war/gwtmodule.
All the gwt generated scripts are in war/gwtmodule and you need to upload them per compilation into appengine.
These are generated every build in compilation phase and hence are not checked into svn.
They need to be in deployment folder for APP Engine.
I suggest you go through the GWT teams excellent document for App Engine with GWT https://developers.google.com/web-toolkit/doc/latest/tutorial/appengine
Edit -
<modulename>.nocache.js loads <longnumeric>.cache.html based on browser * language permutation. GWT compiles your java code to create the <modulename>.nocache.js and the relevant cache.html files. cache and nocache indicates whether browser is supposed to cache or not cache the file.
You will have the .nocache.js script reference in your html file for the gwtapp.
It's normal for the GWT compiler to build different javascript files for each permutation. A permutation is for a specific user-agent (browser, eg ie9 gecko (ff), webkit (chrome/safari)) and language (English, French). So you've correctly uploaded all the output files for the chrome browser, presumably in English. It would seem, as you say, that you're filtering out other files from uploading, and that some of those files are requested when using a different permutation for Firefox in English. You should try not to filter those files.

Resources