2

I've got a Pi 4 with Raspbian 10 and apache2 2.4.38, with default option. I can put a "hello world" index.html in /var/www/html/ and access it in Chromium (http://localhost), or from another laptop in my home network (http://piIP).

I've made a Flutter web application with (in a laptop):

  1. flutter create -t skeleton flutter_skeleton
  2. cd flutter_skeleton
  3. flutter build web
  4. Copy the content of flutter_skeleton/build/web to the Pi /var/www/html folder
  5. In the Pi, sudo service apache2 restart

I can see the flutter app from another machine in the same network (http://piIP). However, in the Pi itself, with Chromium (http://localhost) I can only see the favicon and the title, but the page is blank.

I have accessed the developer tools in Chromium (Ctrl+Shift+I) and the console shows:

Failed to load resource:
net::ERR_NAME_NOT_RESOLVED

is this an apache2 configuration issue or an issue with Flutter? Any pointers to what may be causing this or how to solve it?

asked Jan 18, 2023 at 12:44

1 Answer 1

0

Default renderer for web app is CanvasKit. In https://github.com/flutter/flutter/issues/78235# they explain that "We don't yet automatically bundle CanvasKit for offline development." there is a workaround but I tried using the html renderer and it worked.

flutter build web --web-renderer html
answered Jan 18, 2023 at 21:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.