I have an Angular script which goes to my server and grabs some data. The call looks like the following:
$http.post(url).success(function(response) {
// Do some work...
// Go to the link that the server provided
window.location.href = response.link;
});
So the user will then be redirected to download the file (the file is hosted on S3). The file downloading and everything works...but in Safari I get the following in my console:
Failed to load resource: Frame load interrupted
This is despite the fact that the file was downloaded successfully! Is there anything i'm missing here? No other browser has this error, however, even in Safari, the file downloads and I still get the error.
Related
I have the backend server.js file in a folder labeled server alongside a client folder. I have express, cors, and nodemon installed as dependencies in the server folder, and performed a CRA to generate the front end.
However, I created an endpoint to return a json object to test if the server is working and it is not.
Step 1:
First, I attempted to set the "/" endpoint to return a res.send({message: "welcome to the server"}) and display it on the dom.
RESULT:
Cannot Get /
---In the Console of the Chrome browser I see a 404 for the path http://localhost:5000/weather although I've defined the endpoint as instructed, and in Firefox Dev Edition I see that the Content Security Policy blocked a resource http://localhost:5000/favicon
Step 2:
This lead me to attempt a HTTP response header that would include the security policy directives being violated.
Step 3:
Hereafter I learned that the diagnostics are throwing this error because servers by their nature do not serve the contents of the root directory, therefore I included a static path for the folder where that resource would be located to circumvent the cause of the 404 error. I lastly updated the file path in index.html where the /favicon.ico is being referenced and removed the %public% from its url so that it is an exact path to the public folder
Step 4:
Because the combination of configuring the Content Security Policy HTTP request header, updating the path for the server to resolve to the public client folder, and opening it in different browsers did not work. I tried one final thing that I've read from mining stack overflow: removing the devtools.JSONview.enabled from my Firefox browser. To no avail..
What could be the source of this problem? I've tried every solution ive seen so far.. is there something I've overlooked? Does Helmut really fix this issue? If so, what directive would it add that I haven't already? Please, and Thank you
Setting Response Header to include Content Security Policy with relevant directives,
Updating the file path of the favicon.ico resource and setting a static path for express to locate missing directory,
And updating browser settings in Firefox, attempted in Chrome to no avail.
I have a project in react that works on the computer excellently.
But after I do build and upload it to the server all the json files in the public folder get a 404 error (even when I try to access them directly and click on the url I get the same error.)
But the icon and png files from the same folder do appear.
Another problem (which is probably also related) is that when I go through the link pages on the site it goes great. But if I type them directly in the url I get a 404 error message
I tried to add to json
"homepage": ".", "
But even that did not help.
Anyone have an idea?
edit:
the json works .. I had to change the settings of the mime types according to the instructions: https: //docs.plesk.com/en-US/obsidian/administrator-guide/website-management/websites-and-domains/extended- website-management / using-virtual-directories-windows / adding-and-removing-mime-types.65216 /
But I was still left with the problem that when I go directly to the url address it makes me an error page (when the project is on the local host, it works fine!)
Regards,
I'm trying to host my own web server, so i redirected traffic from the domain to my computer. Traffic is successfully reaching my computer and the website is being displayed except ExpressJS is not serving the only CSS file so the content on my website is all over the place because its not being styled.
The failed GET of the CSS file is seen in the console:
resource: net::ERR_CONNECTION_TIMED_OUT xxx.xx.xx.xxx/styles.176e4d821cc3a21887b2.bundle.css Failed to load
Looking further into the error we see it is the only file that failed, even though all the files are in the same physical directory as you see on the next image:
I'm using Angular and this is my dist deployment folder and you can see the CSS file is in the same locations as the JS files but only the CSS file fails to be GET'd:
In Express i have the following which seems to serve the JS and HTML files but not the CSS file:
app.use(express.static(path.join(__dirname, '/')));
Also, everything works perfect on localhost, its only on traffic redirected from my .com website that the site fails to GET the css file.
I'm building a signed url to download a Google Cloud Storage File via Google App Engine and I get the following error:
http://storage.googleapis.com/BUCKET/file?GoogleAccessId=name#appspot.gserviceaccount.com&Expires=1470185565&Signature=SIGNATURE&response-content-disposition=attachment;filename=blah.png
Failed to load resource: Frame load interrupted
The weird thing is, the error doesn't hinder anything. The file still downloads, even in Safari - and I only get the error in Safari.
I am just confused on why this error is happening if the URL works and the file downloads.
When I'm running my HTML page through a server I'm always getting an error with my angular JavaScript file included. But it runs fine without local server in Mozilla Firefox and Safari but not with Google Chrome (XML errors with Google Chrome).
//localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js
Failed to load resource: the server responded with a status of 404 (File not found)
Failed to load resource: the server responded with a status of 404 (File not found)
angular.js:4361Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.0/$injector/modulerr?p0=controllerapp&p1=Er…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.4.0%2Fangular.min.js%3A19%3A264)
The Screenshot of error message in console
You have error in js file path .
//localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js
So index file is unable to locate the file.
Users/harsha/Documents/angular%20js/nganimate.js
The path of your server isn't the one from your C: it's relative from where your start your server. If you need us to figure out from where your server start, you need to tell us what is the server.
And if it's the grunt web server, show us your build file.