Search code examples
flutter-web

Flutter web application is working fine on 'localhost', but when deploying on the server it shows a blank screen


When I run flutter run -d, the Chrome application works fine, but when I deploy on an hPanel server, it shows a blank screen. This is an inspect console show:

Enter image description here

How can I fix it?


Solution

  • I understand the issue.

    I am not using the root directory of the website, like "your_domain.com/web", so that is why I have to rename the folder in index.html from "/" to "/web/".

    Example: In file index.html:

    <base href="/"> to <base href="/web/">.