![](/img/trans.png)
[英]TS2307: Cannot find module './tables.module.css' or its corresponding type declarations
[英]TS2307: Cannot find module '_rc-trigger@5.2.0@rc-trigger' or its corresponding type declarations
當我嘗試在 GitLab 上而不是在我的設備上部署應用程序時,會發生此錯誤。 我最近剛剛將 Antd 更新到最后一個版本,並且出現了這個問題。
僅在我嘗試在 Gitlab 上構建它時發生
ERROR in /usr/src/app/node_modules/antd/es/tooltip/placements.d.ts
ERROR in /usr/src/app/node_modules/antd/es/tooltip/placements.d.ts(16,73):
TS2307: Cannot find module '_rc-trigger@5.2.0@rc-trigger' or its corresponding type declarations.
ERROR in /usr/src/app/node_modules/antd/lib/tooltip/placements.d.ts
ERROR in /usr/src/app/node_modules/antd/lib/tooltip/placements.d.ts(16,73):
TS2307: Cannot find module '_rc-trigger@5.2.0@rc-trigger' or its corresponding type declarations.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! optimax@1.1.6 build:dev: `webpack -p --env.stage --env.optimax --max_old_space_size=512`
npm ERR! Exit status 2
tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"outDir": "./dist/",
"noImplicitAny": true,
"module": "esnext",
"target": "es6",
"jsx": "react",
"moduleResolution": "node",
"skipDefaultLibCheck": true,
"strictNullChecks": true,
"allowJs": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"inlineSources": true,
"sourceMap": true,
"experimentalDecorators": true,
"types": ["react", "node"],
"typeRoots": ["node_modules/@types"],
"baseUrl": "./",
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
有時我們會遇到在node_modules
中輸入錯誤的問題,這可能與我們的代碼無關。 就我個人而言,我熱衷於在大多數用例中將其關閉。
在您的配置中,您也將其關閉,但它是已棄用的skipDefaultLibCheck
值,將替換為skipLibCheck
。
{
"skipLibCheck": true,
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.