-
-
Notifications
You must be signed in to change notification settings - Fork 214
fix: Flutter Web build failure with ambiguous import from sembast and idb_shim
#1093
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
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
…endencies Update sembast from ^3.6.0 to ^3.7.4+2 and sembast_web from ^2.2.0 to ^2.4.0+4 to fix the ambiguous import of Database class between idb_shim and sembast packages. Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
sembast and idb_shim
|
🚀 Thanks for opening this pull request! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1093 +/- ##
=======================================
Coverage 43.75% 43.75%
=======================================
Files 61 61
Lines 3588 3588
=======================================
Hits 1570 1570
Misses 2018 2018 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Why are the build numbers necessary in the range specifications?
Changed sembast from ^3.7.4+2 to ^3.7.4 and sembast_web from ^2.4.0+4 to ^2.4.0 Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
packages/dart/pubspec.yaml
Outdated
| #Database | ||
| sembast: ^3.6.0 | ||
| sembast_web: ^2.2.0 | ||
| sembast: ^3.7.4+2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're not necessary. The build numbers were just the specific versions I referenced when analyzing the fix. Removed them in 6bd7e4d - now using ^3.7.4 and ^2.4.0.
# [dart-v9.4.3](dart-9.4.2...dart-9.4.3) (2025-12-04) ### Bug Fixes * Flutter Web build failure with ambiguous import from `sembast` and `idb_shim` ([#1093](#1093)) ([71aa5f2](71aa5f2))
|
🎉 This change has been released in version dart-v9.4.3 |
# [flutter-v10.6.2](flutter-10.6.1...flutter-10.6.2) (2025-12-04) ### Bug Fixes * Flutter Web build failure with ambiguous import from `sembast` and `idb_shim` ([#1093](#1093)) ([71aa5f2](71aa5f2))
|
🎉 This change has been released in version flutter-v10.6.2 |
Pull Request
Issue
Closes: #1034
Approach
Flutter Web builds fail due to the
Databaseclass being defined in bothidb_shimandsembastpackages, causing an ambiguous import error:The older
sembast_web(^2.2.0) depends onidb_shimversions that have this name collision. Updated dependencies to versions where this is resolved:sembast:^3.6.0→^3.7.4sembast_web:^2.2.0→^2.4.0Applied to both
packages/dart/pubspec.yamlandpackages/flutter/pubspec.yaml.Tasks
Original prompt
This section details on the original issue you should resolve
<issue_title>Flutter Web build fails with ambiguous import from sembast and idb_shim</issue_title>
<issue_description>### New Issue Checklist
Issue Description
Compiling a Flutter web application fails due to a name collision in transitive dependencies (sembast and idb_shim). The compiler throws an error because the class Database is defined in both packages, leading to an ambiguous import.
Steps to reproduce
Actual Outcome
/home/rafgui/.pub-cache/hosted/pub.dev/idb_shim-2.3.2/lib/utils/idb_import_export.dart:9:1: Error: 'Database' is imported from both 'package:idb_shim/idb.dart' and 'package:sembast/src/api/v2/database.dart'.
import '../idb_client.dart';
^^^^^^^^
/home/rafgui/.pub-cache/hosted/pub.dev/idb_shim-2.3.2/lib/src/sembast/sembast_factory.dart:10:1: Error: 'Database' is imported from both 'package:idb_shim/idb.dart' and 'package:sembast/src/api/v2/database.dart'.
import 'package:sembast/sembast_memory.dart';
^^^^^^^^
/home/rafgui/.pub-cache/hosted/pub.dev/idb_shim-2.3.2/lib/src/sembast/sembast_factory.dart:97:11: Error: 'DatabaseException' is imported from both 'package:idb_shim/src/database_exception.dart' and
'package:sembast/src/api/exception.dart'.
throw DatabaseException('getDatabaseNames not supported');
^^^^^^^^^^^^^^^^^
Unhandled exception:
Unsupported operation: Unsupported invalid type InvalidType() (InvalidType). Encountered while compiling file:///home/rafgui/.pub-cache/hosted/pub.dev/idb_shim-2.3.2/lib/utils/idb_import_export.dart, which
contains the type: FunctionType(Future<Map<dynamic, dynamic>> Function()).
parse-community/Parse-SDK-Flutter#0 LibraryCompiler._typeCompilationError (package:dev_compiler/src/kernel/compiler_new.dart:4451)
#1 LibraryCompiler._emitType (package:dev_compiler/src/kernel/compiler_new.dart:4416)
#2 LibraryCompiler._emitFunctionTagged (package:dev_compiler/src/kernel/compiler_new.dart:4263)
#3 LibraryCompiler._emitLibraryMembers (package:dev_compiler/src/kernel/compiler_new.dart:4033)
#4 LibraryCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler_new.dart:1313)
#5 LibraryCompiler.emitLibrary (package:dev_compiler/src/kernel/compiler_new.dart:926)
#6 LibraryBundleCompiler.emitModule (package:dev_compiler/src/kernel/compiler_new.dart:163)
#7 IncrementalJavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:300)
#8 FrontendCompiler.writeJavaScriptBundle (package:frontend_server/frontend_server.dart:898)
#9 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:708)
#10 listenAndCompile. (package:frontend_server/frontend_server.dart:1423)
The Dart compiler exited unexpectedly.
Waiting for connection from debug service on Web Server... 18.8s
Failed to compile application.
Expected Outcome
The application should compile and run successfully for the web platform without any dependency conflicts.
Environment
Parse Flutter SDK
9.0.03.35.53.9.2Linux (Raspberry Pi OS)Server
8.2.5Logs
The relevant compilation error logs are included in the "Actual Outcome" section above.
</issue_description>
<agent_instructions>Check whether this issue still exists and if so, fix it.</agent_instructions>
Comments on the Issue (you are @copilot in this sec...
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.