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

[firebase_core]: Error Encountered After Upgrading Firebase Core to v2.30.1: Invalid Conditional Import in _flutterfire_internals Package #12708

Open
1 task done
isaacadariku opened this issue Apr 25, 2024 · 6 comments
Assignees
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. Needs Attention This issue needs maintainer attention. platform: all Issues / PRs which are for all platforms. type: bug Something isn't working

Comments

@isaacadariku
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Core

Which platforms are affected?

No response

Description

After upgrading Firebase Core from version 2.27.0 to version 2.30.1, running the build runner resulted in the following error in the log output.

The error originates from the _flutterfire_internals package v1.3.32. Downgrading the package to v1.3.31 by overriding it, resolved the error. It's noted that the error was addressed in a merged pull request: PR #12698, which was released in version 1.3.32.

Expected Behavior

The build runner should execute without errors.

Current Behavior

The build runner fails with the reported error.

Reproducing the issue

Upgrade Firebase Core to version 2.30.1.
Using the latest build_runner: ^2.4.9
Run the build runner dart run build_runner build --delete-conflicting-outputs

Firebase Core version

2.30.1

Flutter Version

3.19.6

Relevant Log Output

[SEVERE] build_modules:module_library on package:_flutterfire_internals/_flutterfire_internals.dart (cached):

Invalid argument(s): Unsupported conditional import of `dart:js_interop` found in _flutterfire_internals|lib/_flutterfire_internals.dart:

import 'src/interop_shimmer.dart' if (dart.library.js_interop) 'dart:js_interop' as js_interop;

This environment does not support direct conditional imports of `dart:` libraries. Instead you must create a separate library which unconditionally imports (or exports) the `dart:` library that you want to use, and conditionally import (or export) that library.
[SEVERE] Failed after 1m 28s

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

@isaacadariku isaacadariku added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Apr 25, 2024
@Lyokone Lyokone self-assigned this Apr 26, 2024
@Lyokone
Copy link
Contributor

Lyokone commented Apr 26, 2024

Thanks for the report I'm looking into it, have you tried to exclude this particular file in your build.yaml file?

@Lyokone
Copy link
Contributor

Lyokone commented Apr 26, 2024

Screenshot 2024-04-26 at 10 18 12

I cannot reproduce the issue, could you give a complete sample?

@Lyokone Lyokone added blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: all Issues / PRs which are for all platforms. labels Apr 26, 2024
@alex-dokienko
Copy link

alex-dokienko commented Apr 27, 2024

hello @Lyokone ,

my comment not related to mentioned issue, but if I can please ask to do another version release to include 10.11.1 firebase js library https://firebase.google.com/support/release-notes/js
to resolve following issue
firebase/firebase-js-sdk#8145
which is long running annoying problem for my flutter app, please help 🙏

@rokk4
Copy link

rokk4 commented Apr 27, 2024

Same error here:

Deprecated. Use `dart run` instead.
[INFO] Generating build script completed, took 188ms
[INFO] Setting up file watchers completed, took 4ms
[INFO] Waiting for all file watchers to be ready completed, took 676ms
[INFO] Reading cached asset graph completed, took 876ms
[INFO] Checking for updates since last build completed, took 1.1s
[INFO] Running build completed, took 247ms
[INFO] Caching finalized dependency graph completed, took 898ms
[SEVERE] build_modules:module_library on package:_flutterfire_internals/_flutterfire_internals.dart (cached):

Invalid argument(s): Unsupported conditional import of `dart:js_interop` found in _flutterfire_internals|lib/_flutterfire_internals.dart:

import 'src/interop_shimmer.dart' if (dart.library.js_interop) 'dart:js_interop' as js_interop;

This environment does not support direct conditional imports of `dart:` libraries. Instead you must create a separate library which unconditionally imports (or exports) the `dart:` library that you want to use, and conditionally import (or export) that library.
[SEVERE] Failed after 1.2s

@Lyokone pinning 2.30.0 solves it.

  firebase_core: 2.30.0
  firebase_messaging: ^14.8.0

@elitree
Copy link

elitree commented Apr 28, 2024

I ran into this too. Updating to the latest versions of all the Flutter Firebase packages solved the error for me.

@elitree
Copy link

elitree commented May 1, 2024

For some reason, updating to the latest Firebase packages worked earlier, but now I'm getting the same error again, even with all the latest packages.

Pinning _flutterfire_internals to 1.3.31 solves the error for me.

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: all Issues / PRs which are for all platforms. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants