1

On my flutter web app, I'm using Beamer package to navigate routes.

When testing the app on chrome, everything works fine.

After deploying my app to firebase, pasting route links into the search bar doesnt work.

More accurate description of the issue:

Accessing the "/" Route of the deployed website works fine, reloading it works too. Loading screens routed to via Beamer.of(context).beamToNamed(foo) works fine. But copying the link of a (successfully loaded via beamToNamed) route and pasting it into another tab in my browser leads me to the default 404 error page of firebase. Reloading a successfully loaded page leads me to the same 404 firebase page.

I have no idea how this error occurs. Maybe firebase had an error indexing my routes thats why beamToNamed works but accessing the route directly doesnt?

I appreciate any help.

I tried rebuilding, redeploying, with no effect. Different versions I tried:

Flutter 3.3.10 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 135454af32 (9 days ago) • 2022-12-15 07:36:55 -0800
Engine • revision 3316dd8728
Tools • Dart 2.18.6 • DevTools 2.15.
Flutter 3.3.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 52b3dc25f6 (7 weeks ago) • 2022-11-09 12:09:26 +0800
Engine • revision 857bd6b74c
Tools • Dart 2.18.4 • DevTools 2.15.0

Testing locally through chrome works in debug, profile and release mode, with both of these flutter versions.

Ben Groll
  • 11
  • 2

1 Answers1

0

Figured it out.

During the initialization of firebase to my flutter project, I picked multi-page-website. I looked up the firebase documentation which stated hosting your web app to firebase you have to choose single-page-website instead.

So, I edited the firebase.json file to account for the rewrites (which would normally be done by selecting single-page), and it works.

Ben Groll
  • 11
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 28 '22 at 09:32