In my laravel application, I'm using translation through localization javascript. When I'm using it offline the only localhost it's working fine but on the server, it is giving me GET https://my_url.com/js/lang.js net:: ERR_ABORTED 404 and file is accessed by the browser.
If an HTTP error like 404 is thrown, it means your file can't be found.
Related
So I am making an application and I am pushing it onto a server but when I do, the page displays only HTML. Upon checking the console, it appears to give a Failed to load resource: the server responded with a status of 404 (Not Found) for a whole bunch of my CSS and JS files... I'm not so clued up with stuff being hosted on a server but the program works fine locally and read all the file as it should from the paths, which is in the public/assets folder.
Do you guys know what I could be doing wrong here?
I have been working on my portfolio website for a little over a month now and I was ready to deploy. I am using vuejs but I am not sure what is causing the problem. also this is my first time using github pages so I am not sure what is the root cause of this problem. It shows in github that my site is deployed to https://maxwell-clark.github.io/ but it is returning the following error. "Failed to load resource: the server responded with a status of 404 ()"
I am not sure what exactly is the problem. I have read about adding an 404.html file that is an copy of my index.html file
I am using create-react-app. Everything works until I go to create a build.
I run:
npm run build
The build is created. I then download the build file and upload to a shared server via cPanel.
When I go to load the website I get the following errors in browser console:
Failed to load resource: the server responded with a status of 404 ()
main.a060bf3c.chunk.css:1 Failed to load resource: the server responded with a status of 404 ()
main.b69fe908.chunk.js:1 Failed to load resource: the server responded with a status of 404 ()
(index):1 GET my_url/static/css/main.a060bf3c.chunk.css net::ERR_ABORTED 404
(index):1 GET my_url/static/js/2.57e02e7f.chunk.js net::ERR_ABORTED 404
(index):1 GET my_url/static/js/main.b69fe908.chunk.js net::ERR_ABORTED 404
manifest.json:1 GET my_url/manifest.json 404
manifest.json:1 Manifest: Line: 1, column: 1, Syntax error.
I also added my_url to the package.json:
{
"homepage" : my_url
}
I had this problem before, when I was using FTP to transfer the build directory to the shared server.
It seemed that Filezilla was cutting off the large chunk.js file. However using cPanel did work, although now it is not. Do I need to somehow compress the chunk.js file futher. This is not a large application.
Are the files presents on the ftp (even if uncut)?
main.a060bf3c.chunk.css
2.57e02e7f.chunk.js
main.b69fe908.chunk.js
manifest.json
If they are not presents, well you just have a ftp connection problem.
If they are presents, you just have to check the static file server configuration, it probably does not check under the good directory.
I've downloaded both JavaScript and TypeScript kit and followed Aurelia instructions for routing from the getting started page
The JavaScript example works fine but the TypeScript shows the following error on the console when the app is run:
Failed to load resource: the server responded with a status of 404 (Not Found)
ERROR [app-router] Error: XHR error (404 Not Found) loading http://localhost:8080/welcome.js
ERROR [app-router] Router navigation failed, and no previous location could be restored.
Does anyone have experienced the same problem?
Rob Eisenberg posted an answer to my issue I put up on github.
https://github.com/aurelia/beginner-kits/issues/12
He said to make sure the moduleId of the router looks like this ./welcome.
I have been developing a small app with Sinatra. Locally it works fine but when I deploy it Heroku my JavaScript paths seem to break and I have no idea what is causing this.
My directory set up is I have a "assets" folder in the root of my application with separated folders for both scripts and styles. The scripts folder has a few subdirectories. I have set my public folder in Sinatra using:
set :public_folder, __DIR__ + '/assets'
My styles work correctly and I am drawing a blank on what the problem is. Also worth noting I am using requirejs to load my JavaScript.
Here is the output from the console:
GET http://evening-hamlet-5644.herokuapp.com/scripts/utils/libraries/jquery.js 404 (Not Found) require.min.js:1884
GET http://evening-hamlet-5644.herokuapp.com/scripts/utils/templating/hogan.js 404 (Not Found) require.min.js:1884
2
Uncaught Error: Script error
http://requirejs.org/docs/errors.html#scripterror require.min.js:194
GET http://evening-hamlet-5644.herokuapp.com/scripts/utils/libraries/lodash.js 404 (Not Found) require.min.js:1884
Uncaught Error: Script error
http://requirejs.org/docs/errors.html#scripterror require.min.js:194
GET http://evening-hamlet-5644.herokuapp.com/scripts/utils/libraries/pusher.js 404 (Not Found) require.min.js:1884
Uncaught Error: Script error
http://requirejs.org/docs/errors.html#scripterror
Any help or a kick in the right direction would be great.
Thanks
You could run a console with the heroku toolbelt (something like heroku run bash --app <your app name>) and verify if you have your JS files up.
Greetings!
I'm not a Sinatra hacker, but I don't find any DIR in their docs. Try setting DIR to
File.dirname(__FILE__), which I do see in their docs
It would help if you posted the Sinatra code that renders the links to the javascript files (ie. haml views etc).
However, without the code, I have a feeling it may be because you should be using Sinatra's url helper. If that's not it, and you post your code, I'll take another look.