我收到了很多警告,内容如下:找不到某些东西,但它们在正确的位置上,而且我的应用程序也可以运行,所以这些警告肯定是错误的。 我正在使用webpack版本2.1.0-beta.22和webpack-dev-server 2.1.0-beta.10. 我的项目托管在GitHub这里
你知道怎么解决吗?谢谢!
[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
等)与运行时依赖项分离开来。 - osechettsconfig.json
则出现在不同的位置。因此,我将两个tsconfig.json
合并成了一个,但会遇到新的错误,不过我会继续努力解决问题。我不希望你认为我忽略了你的帮助,我很感激。 - Dan Cancrotsconfig.json
进行了一次小修改,警告消失了。 - Dan Cancro