Laravel Vuejs Uncaught (in promise) ChunkLoadError: Loading chunk blogs-component failed - javascript

I have a Laravel + Vuejs project and while everything works fine on local development, 2 pages are throwing the ChunkLoadError.
I have looked at other issues on SO, and checked my output path, file is really there.
Page is here : https://dev.trouveruncouvreur.ca/guide-toiture and same for https://dev.trouveruncouvreur.ca/city/d-soumission-couvreur-toiture-Brossard
Error is here :
The chunk is available if you click on the link https://dev.trouveruncouvreur.ca/js/blogs-component.js
Edit: I deleted the project from the dev server, and reinstalled everything without success. I keep having the same issue. I did install on another server I have access to, and the error is gone, pages are all served correctly. We just found out client on dev server is using Cloudflare, so once we have acces, we can delete cache and see how it goes.

In this case, Cloudflare's cache was the culprid. All vues files/chunk are now correctly served.

Related

Having some trouble with php mail on localhost with XAMPP

I'm trying to work locally so I installed XAMPP and need help resolving an issue while sending mail via a php script on localhost. I've tested everything on a web-facing server and it works fine.
I'm getting the error 'Cannot POST /php/mail.php' from http://localhost:3000/php/mail.php.
I've changed the php.ini and sendmail.ini files and believe they are correctly configured for it to work.
Getting some errors in the DevTools console related to inline scripts but I think they are related to the error page.
Is there somewhere else I can look to debug this error?

How to avoid "Content Security Policy: The settings of the page blocked the loading of a resource inline ("default-src")"?

i am developing an Ionic 4 App. But suddenly after starting the app with ionic serve --devapp i just got the error the text Cannot GET / on my page.
I have no idea what i did to make this error appear. Earlier i ran the command ionic cordova resources but i don't think that the error is related to the command...
I also get the error
Module not found: Error: Can't resolve 'core-js/es7/reflect'
in my Terminal, but i don't know if this error coheres with the error above.
Use ionic run, or set up a proxy, to avoid CORS issues.
Ionic posted a blog article about this, which would be useful if you need to use ionic serve for some reason. You almost certainly don't, however.

Mean app login not working on heroku

I have followed many tutorials on how to get mongodb and MEAN to work on heroku, and none of them have worked for me, I keep getting the 503 application error.
First I create the app, I do heroku addons:docs mongolab in the commandline, and after that I check my config and change my code so the mongoose connection is changed to the config string like this:
mongoose.connect(process.env.MONGOLAB_URI || mongodb://example:example#ds053312.mongolab.com:53312/todolist');
the second part is just an example, the one I use is the one with my information.
So after this I push my app to heroku, but when I try to run it, it still gives me the application error, and in f12 it says it's
Failed to load resource: the server responded with a status of 503
(Service Unavailable)
https://myapp.herokuapp.com/favicon.ico
What am I doing wrong? I have tried everything and none of the tutorials are working for me
EDIT: I have managed to get rid of the error by doing the following:
$ git init
$ git add .
$ git commit -m "initial version"
$ heroku apps:create
however, now that my app loads, it appears that the login and sign up features of my app doesn't work, I fill out the sign in/log in form and submit but the page just stays where it is without changing. Is there something else I was supposed to do to get these features to work?
I came here because my Heroku - deploy Login wasn't working, but Localhost was. Turns out I forgot to change the Login POST route.

Javascript not loading due to net::ERR_CONTENT_LENGTH_MISMATCH

I've got an app that runs fine locally, but barfs in production. (Classic problem, right?)
In production, the JS isn't firing correctly. When I open up the browser console, I see this error:
net::ERR_CONTENT_LENGTH_MISMATCH
When I look in the network tab of Developer Tools, is shows that it failed on a GET request for text/html.
It's a cryptic error. I've only found two other SO posts that even mention is and they're unsolved. (For the interested: first post and second post)
Any idea (1) what it means or (2) how to resolve it?
I am getting Error: net::ERR_CONTENT_LENGTH_MISMATCH
Have a look at your server logs to determine what the real issue is.
For me the problem lay somewhere between nginx and file permissions:
tail -f /usr/local/var/log/nginx/error.log or run nginx -t to determine your conf location, where you could specify a custom log path.
refresh the asset in your browser, eg http://localhost:3000/assets/jquery/jquery.js
You may see something like this in the logs:
"/usr/local/var/run/nginx/proxy_temp/9/04/0000000049" failed (13:
Permission denied) while reading upstream for file xyz
Heres how I fixed:
sudo nginx -s stop
sudo rm -rf /usr/local/var/run/nginx/*
sudo nginx
According to this bug report, that error occurs when an external resource length does not match the Content-Length header given in the response.
This might occur because of a misconfigured server, or (as a stretch) maybe some BOM characters got put into the file, or maybe even different lines endings (are you writing on a DOS machine and deploying to a UNIX machine?) may cause issues.
Hope this helps.
I had a similar issue when trying to interpret JSON results. It turned out that somewhere along the line an odd character landed in the database - in this instance the culprit was "â??". It is not clear how this value arrived in the database, but it is likely related to HTML encoding issues - "Â" character showing up instead of " " Either way, after removing the odd characters, the problem was solved.
I had similar issue
[crit] 6889#0: *14817 open() "/var/cache/nginx/proxy_temp/3/02/0000000023" failed (13: Permission denied) while reading upstream
it was because Nginx worker process were not able to access folder /var/cache/nginx/proxy_temp/ - I just changed the folder permissions and everything started working
I had similar issue developing locally on MAMP and using Chrome as browser. Same problematic websites on the live servers had no such issues. First I thought it was MAMP that was playing around and I checked settings like PHP versions mismatch, apache version etc., reinstalled, but the issue remained. At the end I just switched to using Brave browser (was delaying the shift to Brave for a while anyway) and that fixed it for me.
Hope this helps.

Javascript files 404'ing in my Sinatra app on Heroku

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.

Categories

Resources