WebStorm последняя версия 2019.3 и Angular 9. Получение Не удается найти ошибки модуля - PullRequest
0 голосов
/ 31 марта 2020

После обновления до Angular 9 я продолжаю получать ошибки в консоли ошибок TypeScript ... но при запуске ts c в командной строке версии пакета ошибок не возникает.

enter image description here

мой tsconfig

{
  "compileOnSave": false,
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "preserveWhitespaces": true
  },
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "esnext",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "paths": {
      "sax": [
        "node_modules/sax"
      ],
      "timers": [
        "node_modules/timers"
      ],
      "stream": [
        "node_modules/stream"
      ]
    },
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

и мой tsconfig.app. json

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": [],
    "module": "esnext",
    "moduleResolution": "node"
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "src/test.ts",
    "tmp/**/",
    "tmp/**/*.ts",
    "src/**/*.spec.ts"
  ]
}


есть идеи?

Спасибо

Шон

1 Ответ

0 голосов
/ 01 апреля 2020

обнаружил проблему, имел оригинальный tsconfig. json

"baseUrl": "./",

и переопределил с помощью tsconfig.app. json INSIDE ./src dir:

"baseUrl": "./",

так что tsconfig.app. json должен был переопределить оригинал, но кажется, что WebStorm возвращался и четвертый (определенно ошибка), поэтому исправил его, изменив исходный tsconfig. json на

"baseUrl": "./src",

так что теперь и tsconfig в root, и tsconfig.app в './src' будут указывать на sr c

"baseUrl": "./src", in root tsconfig.json
"baseUrl": "./", in ./src/tsconfig.app.json

и теперь все хорошо ... Итак, WebStorm получает путать и не использовать последний, который он должен.

хотя это помогает кому-то,

Шон.

...