Closed muthurathinam closed 5 years ago
@casz Help me with the following:
I got the same problem runningtsc --project .\src\tsconfig.json
.
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "/",
"target": "es6",
"lib": ["es6"],
"types": [
"reflect-metadata",
"jest",
"node"
],
"module": "commonjs",
"outDir": "dist",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"strictNullChecks": true
},
"typeRoots": [
"node_modules/@types",
"node_modules/@microsoft/microsoft-graph-client",
"node_modules/@microsoft/microsoft-graph-types"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"src/**/*.spec.ts"
]
}
tsconfig.app.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../dist/app",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
Ok, changing tsconfig.json to use "lib": ["es6", "dom"],
did the trick.
Closed as no response from the user cc: @casz
tsconfig.json did the trick 😅
the readme says it can be user serverside. so I don't want to include "dom" in my tsconfig. isnt there a better solution for this?
In a Node.js server project I ended up requiring this module instead of importing it to work around the type errors.
This module needs correct server typings.
It is still an issue over a year later and the above solution does work, but it is not nice.
I managed to solve it using @tsconfig/node16, seemingly because of skipLibCheck setting in it.
"skipLibCheck": true
Moving this issue from msgraph-typescirpt-typings
Missing types in @microsoft/microsoft-graph-client's 1.3.0 release:
node_modules/@microsoft/microsoft-graph-client/lib/src/common.d.ts(41,39): error TS2304: Cannot find name 'RequestInit'. node_modules/@microsoft/microsoft-graph-client/lib/src/content/BatchRequestContent.d.ts(11,14): error TS2304: Cannot find name 'Request'. node_modules/@microsoft/microsoft-graph-client/lib/src/content/BatchRequestContent.d.ts(21,38): error TS2304: Cannot find name 'RequestInit'. node_modules/@microsoft/microsoft-graph-client/lib/src/content/BatchResponseContent.d.ts(54,41): error TS2304: Cannot find name 'Response'. node_modules/@microsoft/microsoft-graph-client/lib/src/content/BatchResponseContent.d.ts(59,33): error TS2304: Cannot find name 'Response'. node_modules/@microsoft/microsoft-graph-client/lib/src/content/BatchResponseContent.d.ts(64,55): error TS2304: Cannot find name 'Response'. node_modules/@microsoft/microsoft-graph-client/lib/src/tasks/LargeFileUploadTask.d.ts(42,28): error TS2304: Cannot find name 'File'. node_modules/@microsoft/microsoft-graph-client/lib/src/tasks/LargeFileUploadTask.d.ts(93,44): error TS2304: Cannot find name 'Blob'. node_modules/@microsoft/microsoft-graph-client/lib/src/tasks/LargeFileUploadTask.d.ts(107,42): error TS2304: Cannot find name 'Blob'. node_modules/@microsoft/microsoft-graph-client/lib/src/tasks/LargeFileUploadTask.d.ts(107,49): error TS2304: Cannot find name 'File'. node_modules/@microsoft/microsoft-graph-client/lib/src/tasks/OneDriveLargeFileUploadTask.d.ts(44,41): error TS2304: Cannot find name 'Blob'. node_modules/@microsoft/microsoft-graph-client/lib/src/tasks/OneDriveLargeFileUploadTask.d.ts(44,57): error TS2304: Cannot find name 'File'.
cc: @casz