【发布时间】:2021-01-15 11:09:11
【问题描述】:
几个月前我创建了一个 Vue JS 应用程序 (vue create <app-name>),在更换计算机后我开始收到以下错误
ERROR in /home/bruno/code/vuejs/rockygym-frontnend/node_modules/ts-toolbelt/out/index.d.ts(4111,10):
4111:10 Type alias 'MergeList' circularly references itself.
4109 | @hidden
4110 | */
> 4111 | type MergeList<O, Path extends List<Key>, O1 extends object, depth extends Depth, I extends Iteration = IterationOf<'0'>> = O extends object ? O extends (infer A)[] ? MergeList<A, Path, O1, depth, I>[] : Pos<I> extends Length<Path> ? OMerge<O, O1, depth> : {
| ^
4112 | [K in keyof O]: K extends Path[Pos<I>] ? MergeList<O[K], Path, O1, depth, Next<I>> : O[K];
4113 | } & {} : O;
4114 | /**
您可以找到完整列表here。一开始我以为是 ESLint 问题,但我尝试添加以下条目 .eslintignore:
node_modules
public
bin
build
node_modules/ts-toolbelt/out/index.d.ts
但由于某些原因,我在运行 vue-cli-service serve --port 1024 时仍然遇到错误。我真的不知道从现在开始在哪里调试。我现在不是立即寻找解决方案,但至少有一些关于在哪里查看和了解导致此类错误的原因的指导。
tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env",
"jest"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules/**"
],
"types": [
"vuetify"
]
}
vue.config.js
module.exports = {
transpileDependencies: [
'vuetify',
],
pwa: {
workboxOptions: {
skipWaiting: true,
},
},
};
【问题讨论】:
标签: angular typescript vue.js eslint