【发布时间】:2022-05-03 19:13:16
【问题描述】:
我正在为 NextJS 使用 Typescript,但我无法构建应用程序,因为它与 auth0/nextjs-auth0 存在一些问题
这就是问题所在。如果我安装它,它将继续检查 auth0/nextjs-auth0 包中的问题。
这里是错误https://imgur.com/a/y7ft7Dq
这是我的 tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": [
"es6",
"es7",
"esnext",
"dom"
],
"allowJs": true, /* Allow javascript files to be compiled. */// "checkJs": true, /* Report errors in .js files. */
"jsx": "preserve", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"removeComments": false,
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"strictFunctionTypes": true, /* Enable strict checking of function types. */
"strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. *//* Additional Checks */
"noUnusedLocals": true, /* Report errors on unused locals. */
"noUnusedParameters": true, /* Report errors on unused parameters. */
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. *//* Module Resolution Options */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"baseUrl": ".", /* Type declaration files to be included in compilation. */
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Specify the location where debugger should locate map files instead of generated locations. */
"inlineSourceMap": true,
"inlineSources": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"resolveJsonModule": true,
"isolatedModules": true,
"declaration": true,
"declarationDir": "./node_modules/@auth0/nextjs-auth0/src/auth0-session",
"declarationMap": true
},
"include": [
"pages"
],
"exclude": [
"node_modules"
]
}
【问题讨论】:
-
尝试安装,停止项目,重新运行项目。无论如何,它告诉您 lib 有问题
-
嗨,托尼,请将图片直接粘贴到您的 SO 帖子中,而不是链接到它们。
标签: typescript next.js