Steps to Reproduce
add hive to flutter web project, and run
await Hive.openBox('box');
works well in chrome, but in edge, breaks my app (won't load)
Code sample
await Hive.openBox('box');
Version
apparently the error is related to getAll not being available on Microsoft Edge indexeddb implementation
Thanks @Freundschaft maybe we can fix it using polyfill...
@Freundschaft could you let us know Edge version you're running?
Can someone check if #400 works or not?
Its the trident based edge version (non-chromium).
Can someone check if #400 works or not?
Before the fix I got this error (current hive version):
NoSuchMethodError: Object doesn't support property or method 'getAllKeys' (Error 438)
After the fix I get this error (patched version):
NoSuchMethodError: Unable to get property 'KU' of undefined or null reference (Error 5007)
The testing setup is simple. I just created a new Flutter project and added the hive packages in pubspec.yaml.
Then modified main.dart as follows:
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
void main() async {
await Hive.initFlutter();
await Hive.openBox('settings');
runApp(MyApp());
}
In both cases (current version and "fixed" version) the app fails to work in Microsoft Edge 44.19041.423.0 EdgeHTML 18.19041
I hope it helps.
I've re-run my tests and it actually seems in both versions same error is thrown:
NoSuchMethodError: Object doesn't support property or method 'getAllKeys' (Error 438)
The difference is the line number where it happens due to the patch.
I've re-run my tests and it actually seems in both versions same error is thrown:
NoSuchMethodError: Object doesn't support property or method 'getAllKeys' (Error 438)The difference is the line number where it happens due to the patch.
Thanks, I think it caused by the line below:
if (store.getAllKeys is Function ...
I have to use hasOwnProperty method. ref.
@Constans can you please test latest commit https://github.com/hivedb/hive/pull/400/commits/5d1742f1e9ce969745b5e879c921a5d56cc1ce21 /fix/issues/357?
@Constans can you please test latest commit 5d1742f /fix/issues/357?
Works like a charm after overriding the current with the patch:
dependency_overrides:
hive:
git:
url: git://github.com/hivedb/hive.git
ref: fix/issues/357
path: hive
hive_flutter:
git:
url: git://github.com/hivedb/hive.git
ref: fix/issues/357
path: hive_flutter
hive_generator:
git:
url: git://github.com/hivedb/hive.git
ref: fix/issues/357
path: hive_generator
This was bugging me for almost 1 year. :))
I have a lot of dependencies in a project and I just assumed it will not work on Microsoft Edge. :)
Thanks for the fix!
Most helpful comment
Works like a charm after overriding the current with the patch:
This was bugging me for almost 1 year. :))
I have a lot of dependencies in a project and I just assumed it will not work on Microsoft Edge. :)
Thanks for the fix!