#nestjs/swagger install errors - node.js

currently, When I install swagger on my nestjs project using yarn install I get the following error. Any ideas what may cause this?
src/ledger/dtos/addOrdersByDate.dto.ts:2:10 - error TS2724: Module
'"../../../node_modules/#nestjs/swagger"' has no exported member
'ApiModelProperty'. Did you mean 'ApiHideProperty'?
2 import { ApiModelProperty } from '#nestjs/swagger';
~~~~~~~~~~~~~~~~
node_modules/#nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25
1 export declare function ApiHideProperty(): PropertyDecorator;
~~~~~~~~~~~~~~~
'ApiHideProperty' is declared here.
src/ledger/dtos/addRebatesCharges.dto.ts:1:10 - error TS2724: Module
'"../../../node_modules/#nestjs/swagger"' has no exported member
'ApiModelProperty'. Did you mean 'ApiHideProperty'?
1 import { ApiModelProperty } from '#nestjs/swagger';
~~~~~~~~~~~~~~~~
node_modules/#nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25
1 export declare function ApiHideProperty(): PropertyDecorator;
~~~~~~~~~~~~~~~
'ApiHideProperty' is declared here.
src/ledger/dtos/addReturns.dto.ts:2:10 - error TS2724: Module
'"../../../node_modules/#nestjs/swagger"' has no exported member
'ApiModelProperty'. Did you mean 'ApiHideProperty'?
2 import { ApiModelProperty } from '#nestjs/swagger';
~~~~~~~~~~~~~~~~
node_modules/#nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25
1 export declare function ApiHideProperty(): PropertyDecorator;
~~~~~~~~~~~~~~~
'ApiHideProperty' is declared here.
src/ledger/dtos/addSellers.dto.ts:2:10 - error TS2724: Module
'"../../../node_modules/#nestjs/swagger"' has no exported member
'ApiModelProperty'. Did you mean 'ApiHideProperty'?
2 import { ApiModelProperty } from '#nestjs/swagger';
~~~~~~~~~~~~~~~~
node_modules/#nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25
1 export declare function ApiHideProperty(): PropertyDecorator;
~~~~~~~~~~~~~~~
'ApiHideProperty' is declared here.
src/ledger/dtos/block.dto.ts:2:10 - error TS2724: Module
'"../../../node_modules/#nestjs/swagger"' has no exported member
'ApiModelProperty'. Did you mean 'ApiHideProperty'?
2 import { ApiModelProperty } from '#nestjs/swagger';
~~~~~~~~~~~~~~~~
node_modules/#nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25
1 export declare function ApiHideProperty(): PropertyDecorator;
~~~~~~~~~~~~~~~
'ApiHideProperty' is declared here.
src/ledger/dtos/transaction.dto.ts:1:10 - error TS2724: Module
'"../../../node_modules/#nestjs/swagger"' has no exported member
'ApiModelProperty'. Did you mean 'ApiHideProperty'?
1 import { ApiModelProperty } from '#nestjs/swagger';
~~~~~~~~~~~~~~~~
node_modules/#nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25
1 export declare function ApiHideProperty(): PropertyDecorator;
~~~~~~~~~~~~~~~
'ApiHideProperty' is declared here.
src/queue/controllers/queue.controller.ts:2:10 - error TS2305: Module
'"../../../node_modules/#nestjs/swagger"' has no exported member
'ApiUseTags'.
2 import { ApiUseTags, ApiOperation, ApiResponse } from
'#nestjs/swagger';
~~~~~~~~~~
src/queue/controllers/queue.controller.ts:10:19 - error TS2345:
Argument of type '{ title: string; }' is not assignable to parameter
of type 'Partial'. Object literal may only specify
known properties, and 'title' does not exist in type
'Partial'.
10 #ApiOperation({ title: 'List queues with message quantity' })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/controllers/configuration.controller.ts:2:24 - error
TS2305: Module '"../../../node_modules/#nestjs/swagger"' has no
exported member 'ApiUseTags'.
2 import { ApiOperation, ApiUseTags } from '#nestjs/swagger';
~~~~~~~~~~
src/shared/controllers/configuration.controller.ts:12:19 - error
TS2345: Argument of type '{ title: string; }' is not assignable to
parameter of type 'Partial'. Object literal may
only specify known properties, and 'title' does not exist in type
'Partial'.
12 #ApiOperation({ title: 'Get configuration variables' })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/controllers/history.controller.ts:2:24 - error TS2305:
Module '"../../../node_modules/#nestjs/swagger"' has no exported
member 'ApiUseTags'.
2 import { ApiOperation, ApiUseTags } from '#nestjs/swagger';
~~~~~~~~~~
src/shared/controllers/history.controller.ts:10:19 - error TS2345:
Argument of type '{ title: string; }' is not assignable to parameter
of type 'Partial'. Object literal may only specify
known properties, and 'title' does not exist in type
'Partial'.
10 #ApiOperation({ title: 'Get history for entity' })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/filters/http-exception.filter.ts:24:34 - error TS2339:
Property 'error' does not exist on type 'string'.
24 error: exception.message.error,
~~~~~
src/shared/filters/http-exception.filter.ts:25:36 - error TS2339:
Property 'message' does not exist on type 'string'.
25 message: exception.message.message,
~~~~~~~
src/shared/filters/http-exception.filter.ts:35:34 - error TS2339:
Property 'error' does not exist on type 'string'.
35 error: exception.message.error,

Based on the documentation from #nestjs/swagger
under "Migration from v3" part, the following decorators have been changed/renamed:
...
#ApiModelProperty is now #ApiProperty
...

There is a list of breaking changes in 4.0 version of swagger package:
https://docs.nestjs.com/openapi/migration-guide#breaking-changes
I guess at least part of the issues is coming from there.

Change ApiModelProperty to ApiProperty

Related

'error TS2300: Duplicate identifier 'DocumentQuery' from ts-mongoose and and mongoose

I am trying to run a local copy of a server I am working on with the following packages.
"dependencies": {
"#types/mongodb": "^4.0.7",
"cors": "^2.8.5",
"express": "^4.18.2",
"mongoose": "^5.10.19",
"nodemon": "^2.0.20",
"ts-mongoose": "0.0.24",
"typescript": "3.9.5"
}
However, when I try to run this very basic app I get the following error message.
node_modules/mongoose/index.d.ts:3033:8 - error TS2300: Duplicate identifier 'DocumentQuery'.
After a bit of googling, I /think/ the issue is that both mongoose and mongoose TS are declaring the same identifier. But I'm unsure how to fix it. I'm also unsure of what info needs to be included as well. The code for the app doesn't actually include DocumentQuery, so I find that confusing as well. What should be my next steps in terms of identify and solving the issue?
Here is a full copy of the error.
node_modules/mongoose/index.d.ts:3033:8 - error TS2300: Duplicate identifier 'DocumentQuery'.
3033 type DocumentQuery<ResultType, DocType extends Document, THelpers = {}> = Query<ResultType, DocType, THelpers>;
~~~~~~~~~~~~~
node_modules/ts-mongoose/plugin.d.ts:4:15
4 interface DocumentQuery<T, DocType extends Document, QueryHelpers = {}> extends mquery {
~~~~~~~~~~~~~
'DocumentQuery' was also declared here.
node_modules/ts-mongoose/plugin.d.ts:4:15 - error TS2300: Duplicate identifier 'DocumentQuery'.
4 interface DocumentQuery<T, DocType extends Document, QueryHelpers = {}> extends mquery {
~~~~~~~~~~~~~
node_modules/mongoose/index.d.ts:3033:8
3033 type DocumentQuery<ResultType, DocType extends Document, THelpers = {}> = Query<ResultType, DocType, THelpers>;
~~~~~~~~~~~~~
'DocumentQuery' was also declared here.
node_modules/ts-mongoose/plugin.d.ts:5:103 - error TS2344: Type 'T & Document<any, any, any>' does not satisfy the constraint 'Document<any, any, any>'.
The types of 'replaceOne(...).$where(...).and' are incompatible between these types.
Type '(array: _FilterQuery<T & Document<any, any, any>>[]) => Query<(T & Document<any, any, any>)[], T & Document<any, any, any>, {}, T & Document<...>>' is not assignable to type '(array: _FilterQuery<Document<any, any, any>>[]) => Query<Document<any, any, any>[], Document<any, any, any>, {}, Document<any, any, any>>'.
Types of parameters 'array' and 'array' are incompatible.
Type '_FilterQuery<Document<any, any, any>>[]' is not assignable to type '_FilterQuery<T & Document<any, any, any>>[]'.
Type '_FilterQuery<Document<any, any, any>>' is not assignable to type '_FilterQuery<T & Document<any, any, any>>'.
Type '_FilterQuery<Document<any, any, any>>' is not assignable to type '{ [P in keyof (T & Document<any, any, any>)]?: Condition<[Extract<(T & Document<any, any, any>)[P], ObjectId>] extends [never] ? (T & Document<any, any, any>)[P] : string | (T & Document<...>)[P]>; }'.
5 populateTs<P extends keyof MaybeItem<NonNullable<T>>>(prop: P): DocumentQuery<Populate<T, P>, T & Document> & QueryHelpers;
~~~~~~~~~~~~
node_modules/ts-mongoose/types/extract.d.ts:10:136 - error TS2344: Type 'R & SubDocument' does not satisfy the constraint 'SubDocument'.
Types of property 'overwrite' are incompatible.
Type '(obj: DocumentDefinition<R & SubDocument>) => R & SubDocument' is not assignable to type '(obj: DocumentDefinition<SubDocument>) => SubDocument'.
Types of parameters 'obj' and 'obj' are incompatible.
Type 'DocumentDefinition<SubDocument>' is not assignable to type 'DocumentDefinition<R & SubDocument>'.
10 declare type DeepExtractProps<T> = T extends ((infer R & SubDocument) | (infer R & SubDocumentNoId)) ? R : T extends (SubDocumentArray<infer R & SubDocument> | SubDocumentArrayNoId<infer R & SubDocumentNoId>) ? Array<{
~~~~~~~~~~~~~~~~~~~~~
node_modules/ts-mongoose/types/singleType.d.ts:21:173 - error TS2344: Type 'Extract<T> & SubDocument' does not satisfy the constraint 'SubDocument'.
Types of property 'overwrite' are incompatible.
Type '(obj: DocumentDefinition<Extract<T> & SubDocument>) => Extract<T> & SubDocument' is not assignable to type '(obj: DocumentDefinition<SubDocument>) => SubDocument'.
Types of parameters 'obj' and 'obj' are incompatible.
Type 'DocumentDefinition<SubDocument>' is not assignable to type 'DocumentDefinition<Extract<T> & SubDocument>'.
21 export declare type ArrayOfElements<T> = IsSchemaType<T, ExtractOptions<T> extends OptionIdDisabled ? SubDocumentArrayNoId<Extract<T> & SubDocumentNoId> : SubDocumentArray<Extract<T> & SubDocument>, Array<T>>;

JSZip produces TS2322 error in node.js using typescript

After adding the import statement:
import JSZip from 'jszip';
The build will produce an error:
TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
For these lines of code:
const env: string = process.env.NODE_ENV;
...
private timeoutTime: number = process.env.VUE_APP_TIME_OUT;
...
node.js version: 14.16.1
jszip version: 3.7.1
typescript: 3.9.4
Removing the import for JSZip the error goes away.
There are multiple instances of this same error - but not in every case where process.env is used.
Not sure how to resolve this.
the properties in process.env have a type string | undefined you have two options
first
cast them props to yow desired type
const env = process.env.NODE_ENV as string;
second
create a file call types.d.ts at yow package.json add a prop call types and set the path to yow new file types.d.ts
{
....
"types":"./types.d.ts",
....
}
in yow tsconfig.json there is a prop call typeRoots assuming yow "baseUrl": "./node_modules"
yow typesRoots will look like:
//tsconfig.json
{
"baseUrl": "./node_modules",
"typeRoots": [
"../types.d.ts",
]
}
add this to the new file
/// <reference types="node" />
declare namespace NodeJS {
interface ProcessEnv {
readonly NODE_ENV: "development" | "production" | "test";
readonly PUBLIC_URL: string;
readonly PORT: string;
}
}
Now add all yow vars there all them vars you set there will have a type string

What do these AngularCli errors mean, when there's no "problems" detected in VsCode?

Firstly, this is a follow up question from here:
and.... secondly, I am only getting these errors in the Terminal btw. I'm not that new to Angular but very new to FireStore, and Firebase :)
I have created an account with Firebase for the first time, and I think I copied over all the api stuff correctly, and when I look in VsCode, no problems show up. However, I was wondering why nothing was showing up in localhost right... so I look into my terminal, the command line, and these are some errors that are showing up.
Heres some steps I took:
Deleted node modules
npm cache clean --force
npm install
but then I'm still getting the same errors!
Build at: 2021-07-19T15:14:31.757Z - Hash: 1d1a58a540ce70023842 - Time: 20427ms
Warning: D:\WEBSITES\Projects\clientpanel\node_modules\angularfire2\node_modules\#angular\fire\__ivy_ngcc__\es2015\firebase.app.module.js depends on 'firebase/app'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: D:\WEBSITES\Projects\clientpanel\node_modules\firebase\firestore\dist\index.esm.js depends on '#firebase/firestore'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: D:\WEBSITES\Projects\clientpanel\src\app\app.module.ts depends on 'angularfire2'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: D:\WEBSITES\Projects\clientpanel\src\app\app.module.ts depends on 'angularfire2/auth'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Warning: D:\WEBSITES\Projects\clientpanel\src\app\app.module.ts depends on 'angularfire2/firestore'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:219:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
219 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ApplicationInitStatus, [{ optional: true; }]>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:220:26 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
220 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ApplicationInitStatus>;
~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:750:26 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
750 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<Compiler>;
~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:5066:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
5066 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<PlatformRef, never>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:5067:26 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
5067 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<PlatformRef>;
~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:6454:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
6454 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<SystemJsNgModuleLoader, [null, { optional: true; }]>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:6455:26 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
6455 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<SystemJsNgModuleLoader>;
~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:6651:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
6651 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<Testability, never>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:6652:26 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
6652 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<Testability>;
~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:6696:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
6696 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<TestabilityRegistry, never>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:9639:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵFactoryDeclaration'.
9639 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ɵConsole, never>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/core/core.d.ts:9640:26 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/src/r3_symbols"' has no exported member 'ɵɵInjectableDeclaration'.
9640 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ɵConsole>;
~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/auth/auth.d.ts:13:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
13 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<AngularFireAuth, [null, { optional: true; }, null, null]>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/auth/auth.d.ts:14:26 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵInjectableDeclaration'.
14 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<AngularFireAuth>;
m ~~~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/auth/auth.module.d.ts:4:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
4 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<AngularFireAuthModule, never>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/auth/auth.module.d.ts:5:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵNgModuleDeclaration'.
5 static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<AngularFireAuthModule, never, never, never>;
~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/auth/auth.module.d.ts:6:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵInjectorDeclaration'.
6 static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<AngularFireAuthModule>;
~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/firebase.app.module.d.ts:48:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
48 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<AngularFireModule, never>;
~~~~~~~~~~~~~~~~~~~~
Error: [0mnode_modules/angularfire2/node_modules/#angular/fire/firebase.app.module.d.ts:49:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵNgModuleDeclaration'.
49 static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<AngularFireModule, never, never, never>;
~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/firebase.app.module.d.ts:50:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵInjectorDeclaration'.
50 static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<AngularFireModule>;
~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/firestore/firestore.d.ts:30:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
30 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<AngularFirestore, [null, { optional: true; }, { optional: true; }, { optional: true; }, null, null, { optional: true; }]>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/firestore/firestore.d.ts:31:26 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵInjectableDeclaration'.
31 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<AngularFirestore>;
~~~~~~~~~~~~~~~~~~~~~~~
0mError: node_modules/angularfire2/node_modules/#angular/fire/firestore/firestore.module.d.ts:7:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
7 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<AngularFirestoreModule, never>;
~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/firestore/firestore.module.d.ts:8:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵNgModuleDeclaration'.
8 static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<AngularFirestoreModule, never, never, never>;
~~~~~~~~~~~~~~~~~~~~~
Error: node_modules/angularfire2/node_modules/#angular/fire/firestore/firestore.module.d.ts:9:25 - error TS2694: Namespace '"D:/WEBSITES/Projects/clientpanel/node_modules/angularfire2/node_modules/#angular/core/core"' has no exported member 'ɵɵInjectorDeclaration'.
9 static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<AngularFirestoreModule>;
~~~~~~~~~~~~~~~~~~~~~
you installed an angular library that is no longer in use - angularfire2 is now just #angular/fire
try this from the terminal window or command window
npm uninstall angularfire2
npm uninstall #angular/fire
npm uninstall firebase
in your module where you are importing angular fire make sure you remove any references to it.
then type
ng add #angular/fire
npm install
npm install firebase

Error when trying to upload G-Cloud-Function

i got a problem when uploading my Cloud-Functions to Firebase.
Using Typescript i need to do some XML-Parsing and therefore i need a package called xmldom-ts, but it shows me this abstract error:
tsc
node_modules/typescript/lib/lib.dom.d.ts:6059:11 - error TS2320: Interface 'HTMLAnchorElement' cannot simultaneously extend types 'HTMLElement' and 'HTMLHyperlinkElementUtils'.
Named property 'toString' of types 'HTMLElement' and 'HTMLHyperlinkElementUtils' are not identical.
6059 interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {
~~~~~~~~~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:6168:11 - error TS2320: Interface 'HTMLAreaElement' cannot simultaneously extend types 'HTMLElement' and 'HTMLHyperlinkElementUtils'.
Named property 'toString' of types 'HTMLElement' and 'HTMLHyperlinkElementUtils' are not identical.
6168 interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils {
~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/document.d.ts:24:5 - error TS2416: Property 'createElement' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '(tagName: string) => ElementImpl' is not assignable to type '(_tagName: string) => HTMLElement'.
Property 'autofocus' is missing in type 'ElementImpl' but required in type 'HTMLElement'.
24 createElement(tagName: string): ElementImpl;
~~~~~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:7989:5
7989 autofocus: boolean;
~~~~~~~~~
'autofocus' is declared here.
node_modules/xmldom-ts/dist/types/document.d.ts:25:5 - error TS2416: Property 'createDocumentFragment' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '() => DocumentFragmentImpl' is not assignable to type '() => DocumentFragment'.
Call signature return types 'DocumentFragmentImpl' and 'DocumentFragment' are incompatible.
The types of 'previousSibling' are incompatible between these types.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
25 createDocumentFragment(): DocumentFragmentImpl;
~~~~~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/document.d.ts:26:5 - error TS2416: Property 'createTextNode' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '(data: string) => TextImpl' is not assignable to type '(_data: string) => Text'.
Call signature return types 'TextImpl' and 'Text' are incompatible.
The types of 'previousSibling' are incompatible between these types.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
26 createTextNode(data: string): TextImpl;
~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/document.d.ts:27:5 - error TS2416: Property 'createComment' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '(data: string) => CommentImpl' is not assignable to type '(_data: string) => Comment'.
Call signature return types 'CommentImpl' and 'Comment' are incompatible.
The types of 'previousSibling' are incompatible between these types.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
27 createComment(data: string): CommentImpl;
~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/document.d.ts:28:5 - error TS2416: Property 'createCDATASection' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '(data: string) => CDATASectionImpl' is not assignable to type '(_data: string) => CDATASection'.
Call signature return types 'CDATASectionImpl' and 'CDATASection' are incompatible.
The types of 'previousSibling' are incompatible between these types.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
28 createCDATASection(data: string): CDATASectionImpl;
~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/document.d.ts:29:5 - error TS2416: Property 'createProcessingInstruction' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '(target: string, data: string) => ProcessingInstructionImpl' is not assignable to type '(_target: string, _data: string) => ProcessingInstruction'.
Property 'sheet' is missing in type 'ProcessingInstructionImpl' but required in type 'ProcessingInstruction'.
29 createProcessingInstruction(target: string, data: string): ProcessingInstructionImpl;
~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:9677:14
9677 readonly sheet: CSSStyleSheet | null;
~~~~~
'sheet' is declared here.
node_modules/xmldom-ts/dist/types/document.d.ts:30:5 - error TS2416: Property 'createAttribute' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '(name: string) => AttrImpl' is not assignable to type '(_name: string) => Attr'.
Call signature return types 'AttrImpl' and 'Attr' are incompatible.
The types of 'previousSibling' are incompatible between these types.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
30 createAttribute(name: string): AttrImpl;
~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/document.d.ts:31:5 - error TS2416: Property 'createEntityReference' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '(name: string) => EntityReferenceImpl' is not assignable to type '(_name: string) => Node'.
Call signature return types 'EntityReferenceImpl' and 'Node' are incompatible.
The types of 'previousSibling' are incompatible between these types.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
31 createEntityReference(name: string): EntityReferenceImpl;
~~~~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/document.d.ts:33:5 - error TS2416: Property 'createAttributeNS' in type 'DocumentImpl' is not assignable to the same property in base type 'DummyDocument'.
Type '(namespaceURI: string, qualifiedName: string) => AttrImpl' is not assignable to type '(_namespaceURI: string, _qualifiedName: string) => Attr'.
Type 'AttrImpl' is not assignable to type 'Attr'.
33 createAttributeNS(namespaceURI: string, qualifiedName: string): AttrImpl;
~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dom-implementation.d.ts:12:5 - error TS2416: Property 'createDocument' in type 'DOMImplementationImpl' is not assignable to the same property in base type 'DummyDOMIMplementation'.
Type '(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null) => DocumentImpl' is not assignable to type '(_namespaceURI: string | null, _qualifiedName: string | null, _doctype: DocumentType | null) => Document'.
Call signature return types 'DocumentImpl' and 'Document' are incompatible.
The types of 'defaultView' are incompatible between these types.
Type 'Window | null' is not assignable to type '(Window & typeof globalThis) | null'.
Type 'Window' is not assignable to type 'Window & typeof globalThis'.
Type 'Window' is not assignable to type 'typeof globalThis'.
12 createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): DocumentImpl;
~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dom-implementation.d.ts:13:5 - error TS2416: Property 'createDocumentType' in type 'DOMImplementationImpl' is not assignable to the same property in base type 'DummyDOMIMplementation'.
Type '(qualifiedName: string, publicId: string, systemId: string) => DocumentTypeImpl' is not assignable to type '(_qualifiedName: string, _publicId: string, _systemId: string) => DocumentType'.
Call signature return types 'DocumentTypeImpl' and 'DocumentType' are incompatible.
The types of 'previousSibling' are incompatible between these types.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
13 createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentTypeImpl;
~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-attr.d.ts:3:31 - error TS2420: Class 'DummyAttr' incorrectly implements interface 'Attr'.
Types of property 'previousSibling' are incompatible.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
3 export declare abstract class DummyAttr extends NodeImpl implements Attr {
~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-cdata-section.d.ts:3:22 - error TS2420: Class 'DummyCDATASection' incorrectly implements interface 'CDATASection'.
Types of property 'previousSibling' are incompatible.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
3 export declare class DummyCDATASection extends CharacterDataImpl implements CDATASection {
~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-character-data.d.ts:3:31 - error TS2420: Class 'DummyCharacterData' incorrectly implements interface 'CharacterData'.
Types of property 'previousSibling' are incompatible.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
3 export declare abstract class DummyCharacterData extends NodeImpl implements CharacterData {
~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-comment.d.ts:3:22 - error TS2420: Class 'DummyComment' incorrectly implements interface 'Comment'.
Types of property 'previousSibling' are incompatible.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
3 export declare class DummyComment extends CharacterDataImpl implements Comment {
~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-document-fragment.d.ts:3:22 - error TS2420: Class 'DummyDocumentFragment' incorrectly implements interface 'DocumentFragment'.
Types of property 'previousSibling' are incompatible.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
3 export declare class DummyDocumentFragment extends NodeImpl implements DocumentFragment {
~~~~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-document-type.d.ts:3:22 - error TS2420: Class 'DummyDocumentType' incorrectly implements interface 'DocumentType'.
Types of property 'previousSibling' are incompatible.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
3 export declare class DummyDocumentType extends NodeImpl implements DocumentType {
~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-document.d.ts:126:14 - error TS2416: Property 'defaultView' in type 'DummyDocument' is not assignable to the same property in base type 'Document'.
Type 'Window | null' is not assignable to type '(Window & typeof globalThis) | null'.
Type 'Window' is not assignable to type 'Window & typeof globalThis'.
Type 'Window' is missing the following properties from type 'typeof globalThis': globalThis, eval, parseInt, parseFloat, and 721 more.
126 readonly defaultView: Window | null;
~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-document.d.ts:147:14 - error TS2416: Property 'onreadystatechange' in type 'DummyDocument' is not assignable to the same property in base type 'Document'.
Type '((this: Document, ev: ProgressEvent<EventTarget>) => any) | null' is not assignable to type '((this: Document, ev: Event) => any) | null'.
Type '(this: Document, ev: ProgressEvent<EventTarget>) => any' is not assignable to type '(this: Document, ev: Event) => any'.
Types of parameters 'ev' and 'ev' are incompatible.
Type 'Event' is missing the following properties from type 'ProgressEvent<EventTarget>': lengthComputable, loaded, total
147 readonly onreadystatechange: ((this: Document, ev: ProgressEvent) => any) | null;
~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-element.d.ts:148:5 - error TS2416: Property 'getBoundingClientRect' in type 'DummyElement' is not assignable to the same property in base type 'Element'.
Type '() => DOMRect | ClientRect' is not assignable to type '() => DOMRect'.
Type 'DOMRect | ClientRect' is not assignable to type 'DOMRect'.
Type 'ClientRect' is missing the following properties from type 'DOMRect': x, y, toJSON
148 getBoundingClientRect(): ClientRect | DOMRect;
~~~~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-element.d.ts:148:5 - error TS2416: Property 'getBoundingClientRect' in type 'DummyElement' is not assignable to the same property in base type 'HTMLElement'.
Type '() => DOMRect | ClientRect' is not assignable to type '() => DOMRect'.
148 getBoundingClientRect(): ClientRect | DOMRect;
~~~~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-element.d.ts:149:5 - error TS2416: Property 'getClientRects' in type 'DummyElement' is not assignable to the same property in base type 'Element'.
Type '() => ClientRectList | DOMRectList' is not assignable to type '() => DOMRectList'.
Type 'ClientRectList | DOMRectList' is not assignable to type 'DOMRectList'.
Type 'ClientRectList' is not assignable to type 'DOMRectList'.
The types returned by 'item(...)' are incompatible between these types.
Type 'ClientRect' is not assignable to type 'DOMRect'.
149 getClientRects(): ClientRectList | DOMRectList;
~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-element.d.ts:149:5 - error TS2416: Property 'getClientRects' in type 'DummyElement' is not assignable to the same property in base type 'HTMLElement'.
Type '() => ClientRectList | DOMRectList' is not assignable to type '() => DOMRectList'.
149 getClientRects(): ClientRectList | DOMRectList;
~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-entity-reference.d.ts:3:22 - error TS2420: Class 'DummyEntityReference' incorrectly implements interface 'Node'.
Types of property 'previousSibling' are incompatible.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
3 export declare class DummyEntityReference extends NodeImpl implements EntityReference {
~~~~~~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-node.d.ts:8:14 - error TS2416: Property 'previousSibling' in type 'DummyNode' is not assignable to the same property in base type 'Node'.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is missing the following properties from type 'ChildNode': after, before, remove, replaceWith
8 abstract previousSibling: Node | null;
~~~~~~~~~~~~~~~
node_modules/xmldom-ts/dist/types/dummy/dummy-processing-instruction.d.ts:3:31 - error TS2420: Class 'DummyProcessingInstruction' incorrectly implements interface 'ProcessingInstruction'.
Property 'sheet' is missing in type 'DummyProcessingInstruction' but required in type 'ProcessingInstruction'.
3 export declare abstract class DummyProcessingInstruction extends CharacterDataImpl implements ProcessingInstruction {
~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:9677:14
9677 readonly sheet: CSSStyleSheet | null;
~~~~~
'sheet' is declared here.
node_modules/xmldom-ts/dist/types/dummy/dummy-text.d.ts:3:22 - error TS2420: Class 'DummyText' incorrectly implements interface 'Text'.
Types of property 'previousSibling' are incompatible.
Type 'Node | null' is not assignable to type 'ChildNode | null'.
Type 'Node' is not assignable to type 'ChildNode'.
3 export declare class DummyText extends CharacterDataImpl implements Text {
~~~~~~~~~
Found 29 errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions# build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions# build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Any idea why i get this error? My package.json:
"dependencies": {
"es6-promise-pool": "^2.5.0",
"firebase-admin": "^8.12.1",
"firebase-functions": "^3.7.0",
"stripe": "^8.67.0",
"xmldom-ts": "^0.3.1",
"xpath-ts": "^1.3.13"
},
npm tsc and vscode show no problems / warnings & i tried npm reinstall multiple times.
Removing xmldom-ts from packages solved the Problem
npm uninstall xmldom-ts

NestJS fastify swagger errors while building app

I'm using fastify adapter
According to the documentation I have installed the swagger adapter for fastify
npm install --save #nestjs/swagger fastify-swagger
And when I import swagger objects
import { DocumentBuilder, SwaggerModule } from '#nestjs/swagger';
Get multiple errors in the building app stage:
node_modules/#nestjs/swagger/dist/decorators/api-body.decorator.d.ts:4:35 - error TS2304: Cannot find name 'Omit'.
4 declare type RequestBodyOptions = Omit<RequestBodyObject, 'content'>;
~~~~
node_modules/#nestjs/swagger/dist/decorators/api-header.decorator.d.ts:3:43 - error TS2304: Cannot find name 'Omit'.
3 export interface ApiHeaderOptions extends Omit<ParameterObject, 'in'> {
~~~~
node_modules/#nestjs/swagger/dist/decorators/api-param.decorator.d.ts:4:33 - error TS2304: Cannot find name 'Omit'.
4 declare type ParameterOptions = Omit<ParameterObject, 'in' | 'schema'>;
~~~~
node_modules/#nestjs/swagger/dist/decorators/api-property.decorator.d.ts:2:45 - error TS2304: Cannot find name 'Omit'.
2 export interface ApiPropertyOptions extends Omit<SchemaObjectMetadata, 'name' | 'enum'> {
~~~~
node_modules/#nestjs/swagger/dist/decorators/api-property.decorator.d.ts:8:80 - error TS2344: Type '"type" | "enum" | "example" | "format" | "deprecated"' does not satisfy the constraint '"name" | "enum"'.
Type '"type"' is not assignable to type '"name" | "enum"'.
8 export declare function ApiResponseProperty(options?: Pick<ApiPropertyOptions, 'type' | 'example' | 'format' | 'enum' | 'deprecated'>): PropertyDecorator;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/#nestjs/swagger/dist/decorators/api-query.decorator.d.ts:4:33 - error TS2304: Cannot find name 'Omit'.
4 declare type ParameterOptions = Omit<ParameterObject, 'in' | 'schema'>;
~~~~
node_modules/#nestjs/swagger/dist/decorators/api-response.decorator.d.ts:3:46 - error TS2304: Cannot find name 'Omit'.
3 export interface ApiResponseMetadata extends Omit<ResponseObject, 'description'> {
~~~~
node_modules/#nestjs/swagger/dist/decorators/api-response.decorator.d.ts:9:48 - error TS2304: Cannot find name 'Omit'.
9 export interface ApiResponseSchemaHost extends Omit<ResponseObject, 'description'> {
~~~~
node_modules/#nestjs/swagger/dist/document-builder.d.ts:20:14 - error TS2304: Cannot find name 'Omit'.
20 build(): Omit<OpenAPIObject, 'components' | 'paths'>;
~~~~
node_modules/#nestjs/swagger/dist/interfaces/schema-object-metadata.interface.d.ts:3:47 - error TS2304: Cannot find name 'Omit'.
~~~~
Has someone ideas what to do?
Okay, I have found the answer.
Open file tsconfig.json and add this line:
{
compilerOptions: {
"skipLibCheck": true
}
}
I'm not sure, that it is the best way because it will skip your node_modules checking while compiling. But to launch, it helps.

Resources