Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FlutterFire]: FlutterFire configure command producing error for Flutter web app. #13498

Open
1 task done
jozenua opened this issue Oct 11, 2024 · 1 comment
Open
1 task done
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. Needs Attention This issue needs maintainer attention. platform: web Issues / PRs which are specifically for web. plugin: cloud_firestore type: bug Something isn't working

Comments

@jozenua
Copy link

jozenua commented Oct 11, 2024

Describe your environment

Operating System version: MacOS sequoia 15.0.1
Browser version: chrome 129.0.6668.90
Firebase SDK version: 10.14.1
Firebase Product: flutterfire, firestore, functions
Firebase CLI version: 13.22.0( also affects 13.7.0)
Flutter version: 3.24.3

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Cloud Functions, Other

Which platforms are affected?

Web

Description

I'm having an issue with flutterfire configuring my app to work with its respective prod firebase project.

I merged the codebase that was tied to another firebase project into a new branch to commence the move to prod.

I then created a firestore DB with the tables I needed in the new project, pointed my local gcloud and firebase cli project configs to the prod project and ran the 'flutterfire configure' command.

It runs for a while and then gives me this error: "TimeoutException after 0:00:15.000000: Future not completed" every time I try to overwrite at least one of the files and completely hangs when I don't try to overwrite firebase.json. Also my my app isn't connecting to firestore and is giving me this error: ' [cloud_firestore/unavailable] Failed to get document because the client is offline.', but I'm pretty sure that the issue is related to this configuration issue

So far, I've tried

  • manually changing the information in the visible config files(firebase.json, firestore.indexes.json, firestore.rules, etc) to match the new project info
  • logging out of both cli environments and then logging back in and trying again
  • deleting firebase sdk plugins and running flutter clean(in case there were any saved caches) and starting the config process from scratch all over again( that only seemed to halfway work since it generated the firebase_options.dart and firebase.json files but firebase.json was missing configs for firestore & cloud functions)
  • and finally, checking my system for cached project config info(haven't been able to find any yet). There also isn't much documentation on flutterfire and it breaking and the issues I've found so far are different from this one.

I would greatly appreciate any assistance I can get on this issue. Thanks in advance!

Reproducing the issue

  • create a repo with two branches
  • create 2 firebase projects
  • add firestore and cloud functions to the projects
  • install firebase cli
  • create a flutter app for web and add flutterfire using dart pub global activate flutterfire_cli
  • run flutterfire configure to initialize the first project
  • install firebase sdk plugins for core, firestore and functions one at a time and running the flutterfire configure command each time you add a new plugin
  • ensure that firebase is working and that the first config is successful
  • commit the first branch
  • then merge the code of the first branch into another branch and switch your working branch to the new branch
  • setup the second firebase project
  • update project config details in your cli using 'firebase use' command
  • run flutterfire configure command again to configure second project in new branch

Firebase Core version

3.3.0

Flutter Version

3.24.3

Relevant Log Output

[debug] [2024-10-11T20:16:01.054Z] ----------------------------------------------------------------------
[debug] [2024-10-11T20:16:01.061Z] Command:       /opt/homebrew/Cellar/node/22.9.0/bin/node /opt/homebrew/bin/firebase projects:list --json
[debug] [2024-10-11T20:16:01.061Z] CLI Version:   13.22.0
[debug] [2024-10-11T20:16:01.061Z] Platform:      darwin
[debug] [2024-10-11T20:16:01.061Z] Node Version:  v22.9.0
[debug] [2024-10-11T20:16:01.061Z] Time:          Fri Oct 11 2024 16:16:01 GMT-0400 (Eastern Daylight Time)
[debug] [2024-10-11T20:16:01.061Z] ----------------------------------------------------------------------
[debug] 
[debug] [2024-10-11T20:16:01.133Z] Object "" in "firebase.json" has unknown property: {"additionalProperty":"flutter"}
[debug] [2024-10-11T20:16:01.144Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2024-10-11T20:16:01.145Z] > authorizing via signed-in user (----me----)
[debug] [2024-10-11T20:16:01.148Z] Checked if tokens are valid: true, expires at: 1728678692228
[debug] [2024-10-11T20:16:01.148Z] Checked if tokens are valid: true, expires at: 1728678692228
[debug] [2024-10-11T20:16:01.150Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=1000
[debug] [2024-10-11T20:16:01.183Z] Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:159:15)
    at writeGeneric (node:internal/stream_base_commons:150:3)
    at Socket._writeGeneric (node:net:958:11)
    at Socket._write (node:net:970:8)
    at writeOrBuffer (node:internal/streams/writable:572:12)
    at _write (node:internal/streams/writable:501:10)
    at Writable.write (node:internal/streams/writable:510:10)
    at Ora.start (/opt/homebrew/lib/node_modules/firebase-tools/node_modules/ora/index.js:304:17)
    at Command.actionFn (/opt/homebrew/lib/node_modules/firebase-tools/lib/commands/projects-list.js:48:73)
    at /opt/homebrew/lib/node_modules/firebase-tools/lib/command.js:235:25
[error] 
[error] Error: An unexpected error has occurred.

Flutter dependencies

Expand Flutter dependencies snippet
  cupertino_icons: ^1.0.6
  go_router: ^14.2.0
  google_fonts: ^6.2.1
  logger: ^2.3.0
  flutter_svg: ^2.0.10+1
  firebase_core: ^3.3.0
  firebase_analytics: ^11.2.1
  firebase_core_web: ^2.17.4
  firebase_analytics_web: ^0.5.9+1
  cloud_firestore_web: ^4.1.0
  cloud_firestore: ^5.4.1
  flutter_animate: ^4.5.0
  gap: ^3.0.1
  feedback: ^3.1.0
  permission_handler_web: ^0.0.2
  file_saver: ^0.2.14
  permission_handler: ^11.0.1
  linked_scroll_controller: ^0.2.0
  dio: ^5.6.0
  responsive_grid_list: ^1.4.0
  cloud_functions: ^5.0.4
  cloud_functions_web: ^4.9.11
  signals: ^5.4.0
  currency_formatter: ^2.2.1
  pkce: ^1.1.0+1
  path: ^1.9.0
  googleapis: ^13.2.0
  device_info_plus: ^10.1.2
  hive: ^2.2.3
  uuid: ^4.4.0

Additional context and comments

No response

@jozenua jozenua added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 11, 2024
@SelaseKay SelaseKay added plugin: cloud_firestore platform: web Issues / PRs which are specifically for web. labels Oct 14, 2024
@SelaseKay
Copy link
Contributor

Hi @jozenua , thanks for the report. Kindly clarify what you mean by "setup the second firebase project"(11th step).

@SelaseKay SelaseKay added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. Needs Attention This issue needs maintainer attention. platform: web Issues / PRs which are specifically for web. plugin: cloud_firestore type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants