Closed thani-sh closed 7 years ago
Hi @mnmtanish sry for answering so late. Where did you get this error? I dont get it on the ng2-example of rxdb. Which typescript-version do you use?
I got this error on Angular v2.0 and Typescript v1.8 I'll try it again using a newer version of typescript.
I'm sorry for the delay. I tried it again with TypeScript v2.0.9. This time I got this error:
Argument of type 'Promise<RxCollection>' is not assignable to parameter of type 'Promise<RxCollection>'.
Property '[Symbol.toStringTag]' is missing in type 'Promise<RxCollection>'.
The code is something like this:
let collectionPromise: Promise<RxCollection>;
collectionPromise = db.collection('test-collection');
i got the same issue here, any news?
here is my fixes:
on typescript compiler options, set moduleResolution to node and use es5 lib instead of es2015 (i don't know the different). then, install these typings: dt~es6-promise
and dt~es6-collections
by using command:
typings install dt~es6-promise and dt~es6-collections --global --save
on typescript compiler options, don't use/set the lib and moduleResolution properties, but still need to install dt~es6-promise
and dt~es6-collections
as well
In v3, the polyfills etc. will not be included, which will fix this issue. Until then, you have to stick to the workarround. I'm sorry.
@labibramadhan es2015 is ES6.
Also Angular 2 should not be used with Typescript < 2 and if you need Promise in Angular 2 you should use the node
typings from @types/node
In Typescript 2 do not use the typings
module! Use @types
alongside typeRoots
in your tsconfig.json
Closing this since no response. It should work in RxDB v3 now, reopen if you think otherwise.
When using with Typescript, the "es6-promise" module causes build errors. For an example, when calling
doc.save()
we get this error.As a temporary solution, we can avoid the error with type assertions. I was wondering whether there's a better way to fix this.