模块分析失败:意外字符'@'(11:0)-7

fquxozlt  于 2021-09-23  发布在  Java
关注(0)|答案(0)|浏览(231)

我的一位朋友在编译后立即面临以下错误。我已经讨论了所有这些解决方案,但这些都与webpack.config.ts有关。但是在我们的项目中,除了tsconfig.json之外,没有这样的文件

ERROR in ./src/app/features/employee-mgmt/emp-facility/emp-facility.module.ts 11:0
Module parse failed: Unexpected character '@' (11:0)
You may need an appropriate loader to handle this file type.
| import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
> @NgModule({
|   declarations: [ennvironmentPageComponent],
|   imports: [
ERROR in ./src/app/features/ennvironment-management/ennvironment-management.module.ts 11:0
Module parse failed: Unexpected character '@' (11:0)
You may need an appropriate loader to handle this file type.
| import { ennvironmentManagementRoutingModule } from './ennvironment-management-routing.module';
|
> @NgModule({
|   declarations: [  ],

不知道如何解决这个问题,因为其他人使用相同的项目结构
当前tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es5",
    "resolveJsonModule": true, 
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ],
    "paths": {
      "device": [
        "dist/sample 1"
      ],
      "sample 1/*": [
        "dist/sample 1/*"
      ],
      "sample 2": [
        "dist/sample 2"
      ],
      "sample 2/*": [
        "dist/sample 2/*"
      ],
      "sample 3": [
        "dist/sample 3"
      ],
      "sample 3/*": [
        "dist/sample 3/*"
      ]
    }
  },
  "include": [
    "src/**/*"
    ],
    "exclude": [
    "node_modules",
    "**/*.spec.ts",
    "**/assets",
    ]
}

谢谢你的帮助。谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题