Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic3 GET http://localhost:8100/null 404 (Not Found)

Don't know why always showing this error for me, but ionic3 project can run as usual.

This is what showing: enter image description hereenter image description here

like image 726
Yuyang He Avatar asked Oct 05 '17 07:10

Yuyang He


2 Answers

Please add some more code so we can point the exact cause of the error, but given that description, seems like you're including an image somewhere in any of your pages, and the src of that image is being set dynamically after getting some information from the server, something like

<img [src]="imageUrl">

where imageUrl is a property from the component code.

The problem is that this imageUrl is null when Angular tries to load the page, so the source of the image is null (that's why you get the 404 when trying to get an image from http:localhost:8100/null; that ending null is because that property is null when the image element is being created in the view).

You could prevent that error by adding an additional check, like

<img *ngIf="imageUrl" [src]="imageUrl">

so the image will only be added if the source is ready.

like image 130
sebaferreras Avatar answered Oct 23 '22 08:10

sebaferreras


Add this & it will solve your query <img *ngIf="imageUrl" [src]="imageUrl">

like image 2
Jignesh Mistry Avatar answered Oct 23 '22 08:10

Jignesh Mistry