You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed to compile Angular project using AngularCompilerPlugin from @ngtools/webpack module having rxdb dependency added.
I go with TypeScript-based webpack configs files, most developers don't, so they don't notice this issue. For example, Angular CLI still goes with JS based configs. I also have no tsconfig.json=>compilerOptions.skipLibCheck option enabled. So a workaround is to enable skipLibCheck compilation option, which disables declaration files checking.
Issue
node_modules/@types/core-js/index.d.ts pollutes a global declarations scope. This is ok if you add this development time dependency explicitly as a developer. But this project leaves no choice having @types/core-js defined as a runtime dependency (dependencies section).
Info
Environment: irrelevant
Adapter: irrelevant
Stack: (Typescript, Angular)
Here is error stack trace output:
ERROR in node_modules/@angular-devkit/core/src/utils/partially-ordered-set.d.ts(21,5): error TS2416: Property 'forEach' in type 'PartiallyOrderedSet<T>' is not assignable to the same property in base type 'Set<T>'.
Type '(callbackfn: (value: T, value2: T, set: PartiallyOrderedSet<T>) => void, thisArg?: any) => void' is not assignable to type '(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any) => void'.
Types of parameters 'callbackfn' and 'callbackfn' are incompatible.
Types of parameters 'set' and 'set' are incompatible.
Type 'PartiallyOrderedSet<T>' is not assignable to type 'Set<T>'.
Property 'toJSON' is missing in type 'PartiallyOrderedSet<T>'.
There is such code in /node_modules/@angular-devkit/core/src/utils/partially-ordered-set.d.ts
exportdeclareclassPartiallyOrderedSet<T>implementsSet<T>{private_items;protected_checkCircularDependencies(item: T,deps: Set<T>): void;clear(): void;has(item: T): boolean;readonlysize: number;forEach(callbackfn: (value: T,value2: T,set: PartiallyOrderedSet<T>)=>void,thisArg?: any): void;/** * Returns an iterable of [v,v] pairs for every value `v` in the set. */entries(): IterableIterator<[T,T]>;/** * Despite its name, returns an iterable of the values in the set, */keys(): IterableIterator<T>;/** * Returns an iterable of values in the set. */values(): IterableIterator<T>;add(item: T,deps?: (Set<T>|T[])): this;delete(item: T): boolean;[Symbol.iterator](): IterableIterator<T>;readonly[Symbol.toStringTag]: 'Set';}
PartiallyOrderedSet implements the Set interface, but there is no toJSON method implemented, while node_modules/@types/core-js/index.d.ts forces toJSON to be implemented.
So is there any reason why @types/core-js is put as a runtime dependency, rather than dev dependency (devDependencies section)?
The text was updated successfully, but these errors were encountered:
Hi @vladimiry Thanks for pointing this out. I do not see a reason why we need @types/core-js in the dependencies. I can also not remember why I added it :)
Case
Failed to compile Angular project using
AngularCompilerPlugin
from@ngtools/webpack
module havingrxdb
dependency added.I go with TypeScript-based webpack configs files, most developers don't, so they don't notice this issue. For example, Angular CLI still goes with JS based configs. I also have no
tsconfig.json=>compilerOptions.skipLibCheck
option enabled. So a workaround is to enableskipLibCheck
compilation option, which disables declaration files checking.Issue
node_modules/@types/core-js/index.d.ts
pollutes a global declarations scope. This is ok if you add this development time dependency explicitly as a developer. But this project leaves no choice having@types/core-js
defined as a runtime dependency (dependencies
section).Info
Here is error stack trace output:
There is such code in
/node_modules/@angular-devkit/core/src/utils/partially-ordered-set.d.ts
PartiallyOrderedSet
implements the Set interface, but there is notoJSON
method implemented, whilenode_modules/@types/core-js/index.d.ts
forcestoJSON
to be implemented.So is there any reason why
@types/core-js
is put as a runtime dependency, rather than dev dependency (devDependencies
section)?The text was updated successfully, but these errors were encountered: