Flutter web asset images not displaying when deployed to web server

You should perhaps check if the file is available as part of your deployment. 404 is the usual error code you received for resource not found. 503 is something related to the server availability or server errors. I would do the following.

Step 1. Check the build folder

Try running the flutter build web command in your project and inspect the build folder. Assuming a pubspec.yaml with following asset configurations.

  assets:
    - js/plotly_hookup.js
    - js/plotly-latest.min.js
    - images/
    - screen_shot.png

I would expect the following inside my build\web\assets folder.

Screen shot of build folder layout

If this is not working as shown, then its time to inspect the pubspec.yaml file and correct the paths.

Step 2: check your hosted folder

Ensure the files as shown above are available in your server where this folder is hosted. Also verify if the server has any configurations to be made specifically for image files or types of images files.


Just do this with flutter 2.2.0 then you are all set.

flutter run -d chrome --web-port=8080  --web-renderer html //port is optional


You should add photos to pubspec.yaml file and upload your assets folder to web server. Probably it is about not uploading folder