我收到一堆警告,如下所示,找不到东西,但它们位于正确的位置,我的应用程序运行时警告必须错误。我使用的是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'进行了更多的调整,并且警告消失了。 –