Dexie.js: import 'dexie-observable': Cannot augment module 'Dexie' with value exports because it resolves to a non-module entity.
I’m trying to include dexie-observable, however the TS transpiler seems to have an issue with that:
ERROR in node_modules/dexie-observable/dist/dexie-observable.d.ts(13,15): error TS2649: Cannot augment module 'Dexie' with value exports because it resolves to a non-module entity.
node_modules/dexie-observable/dist/dexie-observable.d.ts(17,29): error TS2694: Namespace '"@paperwork/web/node_modules/dexie/dist/dexie".Dexie' has no exported member 'Observable'.
node_modules/dexie-observable/dist/dexie-observable.d.ts(34,40): error TS2694: Namespace '"@paperwork/web/node_modules/dexie/dist/dexie".Dexie' has no exported member 'Observable'.
node_modules/dexie-observable/dist/dexie-observable.d.ts(37,39): error TS2694: Namespace '"@paperwork/web/node_modules/dexie/dist/dexie".Dexie' has no exported member 'Observable'.
node_modules/dexie-observable/dist/dexie-observable.d.ts(46,60): error TS2694: Namespace '"@paperwork/web/node_modules/dexie/dist/dexie".Dexie' has no exported member 'Observable'.
node_modules/dexie-observable/dist/dexie-observable.d.ts(99,56): error TS2694: Namespace '"@paperwork/web/node_modules/dexie/dist/dexie".Dexie' has no exported member 'DexieEventSet'.
node_modules/dexie-observable/dist/dexie-observable.d.ts(120,22): error TS2339: Property 'Observable' does not exist on type 'DexieConstructor'.
src/app/app.component.ts(51,11): error TS2345: Argument of type '"changes"' is not assignable to parameter of type '"versionchange"'.
Also, this time it doesn’t seem to be caching related. 😃
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15
Commits related to this issue
- Moved back to 2.0.4 See https://github.com/dfahlander/Dexie.js/issues/847 for more info on this. — committed to paperwork/web by mrusme 5 years ago
For anyone looking for a dirty fix while waiting for official typings, the simplest solution for us was to just remove the typings in the build pipeline to get rid of the build errors. Obviously this isn’t a fix, but I just needed it to compile in a build pipeline.
The only other issue was
Dexie.Syncablewas therefor not a valid member. Fixed by(Dexie as any).SyncableNot proud of these as fixes, but it works temporarily for someone with little type extension experience.
Good luck
I’ve published new versions of dexie-observable and dexie-syncable on npm that should be type-wise compatible with Dexie 3.0. Any feedback on these would be much apprechiated:
Should give you versions 3.0.0-beta.9 on both of them.
error still occurred on 3.0.1
Hello @dfahlander , The same problem occurs with the latest releases:
The issue is with the typings: