我收到一堆警告,如下所示,找不到東西,但它們位於正確的位置,我的應用程序運行時警告必須錯誤。我使用的是webpack版本2.1.0-beta.22和webpack-dev-server 2.1.0-beta.10。我的項目在GitHub上here在Angular-CLI/Webpack項目中未發現警告
你知道我該如何解決這個問題嗎?謝謝!
[WDS] Warnings while compiling.
client:73 ./src/app/debate/claim/claim.component.ts
38:55 export 'Claim' was not found in '../../core/store/claim/claim.model'
Error: export 'Claim' was not found in '../../core/store/claim/claim.model'
at HarmonyImportSpecifierDependency.getWarnings (/Users/Dan/work/bernierebuttals/gba/node_modules/angular-cli/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:34:14)
at /Users/Dan/work/bernierebuttals/gba/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:645:21
at Array.forEach (native)
at /Users/Dan/work/bernierebuttals/gba/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:644:22
at Array.forEach (native)
at Compilation.reportDependencyWarnings (/Users/Dan/work/bernierebuttals/gba/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:643:9)
at Compilation.<anonymous> (/Users/Dan/work/bernierebuttals/gba/node_modules/angular-cli/node_modules/webpack/lib/Compilation.js:505:8)
at Array.forEach (native)
at Compilation.finish
文件結構如下所示:
app
├── core
│ ├── store
│ │ ├── claim
│ │ │ ├── README.md
│ │ │ ├── claim.actions.ts
│ │ │ ├── claim.effects.ts
│ │ │ ├── claim.model.ts
│ │ │ └── claim.reducer.ts
├── debate
│ ├── README.md
│ ├── claim
│ │ ├── claim.component.css
│ │ ├── claim.component.html
│ │ ├── claim.component.spec.ts
│ │ └── claim.component.ts
和./src/app/core/store/claim/claim.model.ts
import { Rebuttal } from '../rebuttal/rebuttal.model';
export interface Claim {
...
你或許應該通過清理你的項目啓動。有兩個'tsconfig.json'文件:一個在根目錄中,另一個在'src'目錄中。很難知道你期望使用哪一個。然後你的'package.json'定義幾次相同的依賴關係。嘗試從運行時依賴關係中正確分離開發依賴項(例如'style-loader','css-loader' ...)。 – osechet
@osechet謝謝。正如你可能知道的那樣,我已經將部分簡化的例子整合到一個項目中,希望能夠綜合在開發人員現實生活中所使用的東西。當然,每個例子都以自己的方式做事,沒有太多的解釋。其中一位在devDependencies中擁有所有的前端代表。 'tsconfig.json'出現在不同的地方。等等。我將兩個'tsconfig.json'合併爲一個,並得到新的錯誤,但會繼續處理它。我不希望你認爲我忽視了你的幫助,我很欣賞。 –
這樣做!我對'tsconfig.json'進行了更多的調整,並且警告消失了。 –