For Flutter Web, should sqlite3.wasm and drift_worker.js versions match the sqlite3 and drift packages in pubspec.lock? #3721
-
|
I lost a few hours debugging an issue before realizing that the versions of sqlite3.wasm and drift_worker.js likely need to match the versions of the sqlite3 and drift packages in my pubspec.lock. Following the documentation here: …I initially used the latest available sqlite3.wasm and drift_worker.js, which didn’t work in my setup. After rechecking everything, I realized this was most likely caused by a version mismatch. This was my mistake and probably due to my lack of experience with Flutter and Drift, but I wanted to share the feedback. If matching versions is a requirement, could this be: This might help others avoid similar confusion. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Thanks for raising this, and sorry for the confusion here! I do my best to make both workers and the The inverse is not true, however. If you use a Drift is still using version 2.x of the
I have added a note to those releases explaining that now.
Builders shouldn't download anything, so this is tricky to do at the moment. I hope we'll have something for this in the future (dart-lang/native#988), but a manual download (or perhaps a script invocation) is the best approach we have for now. |
Beta Was this translation helpful? Give feedback.
Thanks for raising this, and sorry for the confusion here!
I do my best to make both workers and the
sqlite3.wasmfile forwards-compatible, meaning that upgradingdriftor thesqlite3package without upgrading your workers and WebAssembly assets should still work. So you don't always have to watch yourpubspec.lockto ensure you're using the exact same version.The inverse is not true, however. If you use a
sqlite3.wasmfrom version x, the version ofpackage:sqlite3must be at least that version. This is likely what has caused these issues for you. In particular, for the major upgrade from 2.x -> 3.x in thesqlite3package, there is no compatibility between the two versions.Drift is stil…