Getting error when trying to debug on chromes emulator - javascript

I'm trying to run a sample app by using cordovas camera plugin and I got an error, when trying to debug on chromes emulator
Failed to load resource: the server responded with a status of 404 (Not Found)
(http://localhost:8000/android/www/css/images/ajax-loader.gif)

The correct path is css/images/ajax-loader.gif

You are debuging your application in chrome emulator. But you are using the ajax-loader.gif placed in platforms/andoroid/www/css/images change the location of the loader to www folder in the root folder.
css/images/ajax-loader.gif.
In chrome emulator, the files in www folder in the root of project is taken.
Change the location of loader and check whether the problem is solved or not

Related

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

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.

Expo: How to fix web push notification in development when accessing through localhost (and how to fix the `localhost` service worker)?

I am using Expo SDK Version: 36 to generate a PWA.
curl http://$LOCAL_IP:19006/expo-service-worker.js: OK 200
curl http://localhost:19006/expo-service-worker.js: FAIL => Instead of serving expo-service-worker.js it serve the static asset index.html.
It cause the following error in the console:
Failed to register service-worker DOMException: Failed to register a ServiceWorker for scope ('http://localhost:19006/') with script ('http://localhost:19006/expo-service-worker.js'): The script has an unsupported MIME type ('text/html').
The file expo-service-worker.js is not served and this is problematic when you must implement web push notification because only localhost can work without it when site is not served with HTTPS.
Related issues:
https://github.com/expo/expo-cli/issues/2063
https://github.com/expo/expo-cli/issues/2468
How can I fix it?

Rxjs is not found in production

I have an angular2 and play app from here. Everything works fine when I run it in dev mode with sbt run. However I would like to test the production, so I do sbt dist, load the app and get the following errors in console.
http://localhost:9000/assets/lib/rxjs/rx.js Failed to load resource: the server responded with a status of 404 (Not Found)
zone.min.js:1 Error: (SystemJS) Error: XHR error (404 Not Found) loading http://localhost:9000/assets/lib/rxjs/rx.js(…)e.invoke # zone.min.js:1
However when I click on the link I see that a file has been loaded.
Here is the code for system js configuration I am using. Does anyone hava an idea on how to fix this?
The problem was deprecated imports.
change
import { Observable } from "rxjs/rx"
to
import { Observable } from "rxjs/Observable"
in ts source files.

node js fails to serve mobile clients only

I have a node js server on a docker container runing on digital ocean, that serve an angular 2 application bundeled and traspiled with webpack.
When I try to get the application from any computer it works, but if I try to get it from my android device or ipad it fails to load the js files.
The browsers shows this errors:
Failed to load resource: net::ERR_CONNECTION_REFUSED common.js
Failed to load resource: net::ERR_CONNECTION_REFUSED vendor.js
Failed to load resource: net::ERR_CONNECTION_REFUSED app.js
Again it works on desktop chrome/firefox/safari.
Did you check if you has AdBlock or something similar in your devices? Sometimes it can cause errors like this.
Check too if you are using a proxy in the devices connection.
I hope my answer will be helpfulp!

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