"ES5가 아닌 클래스에서 getInternalNameOfClass()를 호출하는 동안 오류가 발생했습니다. AngularFireModule에 내부 클래스 선언이 있어야 합니다."
Terminal -
"WARNING in Invalid constructor parameter decorator in D:/New folder/SilverLife/node_modules/@angular/fire/fesm2015/angular-fire.js:
() => [
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
]
ERROR in getInternalNameOfClass() called on a non-ES5 class: expected
AngularFireModule to have an inner class declaration"
Angular 9 프로젝트에서 Angular firebase를 통합하는 동안 이 문제에 직면했습니다.
에서 대상 변경 시도compilerOptions당신의tsconfig.json부터es5로.es2015
Angular8에서 Angular9로 마이그레이션하는 동안 동일한 문제가 발생했습니다.
Angular9에서는 Angular Ivy라고 하는 새로운 세대의 컴파일 및 렌더링 파이프라인을 도입했습니다.설명서에는 다음과 같이 나와 있습니다.
아이비 애플리케이션은 View Engine 컴파일러로 생성된 라이브러리로 빌드할 수 있습니다.이 호환성은 Angular 호환성 컴파일러(ngcc)라는 도구에 의해 제공됩니다.CLI 명령은 Angular 빌드를 수행할 때 필요에 따라 ngcc를 실행합니다.
출처: https://angular.io/guide/ivy
그래서 프로젝트를 하기 위해서는."target": "es5"작업, 사용 후npm install당신은 ngcc를 실행해야 합니다.
패키지에 추가할 수 있습니다.json 파일:
{
"scripts": {
"postinstall": "ngcc"
}
}
그러면 실행 후 자동으로 실행되어야 합니다.npm install.
다음 intconfig.json을 사용해야 했습니다.
"angularCompilerOptions": {
"enableIvy": false,
}
이상적이지는 않지만 효과가 있었습니다.
추가 중
"scripts": {
"postinstall": "ngcc"
}
포장할 수 있습니다.json and changingtarget로.es2015tsconfig.json이 작동하지 않았습니다. 아마도 다른 설정이 그들을 괴롭혔을 것입니다.
언급URL : https://stackoverflow.com/questions/62733064/error-in-getinternalnameofclass-called-on-a-non-es5-class-expected-angularfi
'programing' 카테고리의 다른 글
| SSMS 버전 18 – 데이터베이스 다이어그램 없음 (0) | 2023.07.03 |
|---|---|
| .NET Core Identity Server 4 인증 VS ID 인증 (0) | 2023.07.03 |
| 서로 다른 두 파일 간의 git diff (0) | 2023.07.03 |
| bash 스크립트 내에서 SQL을 어떻게 실행합니까? (0) | 2023.06.28 |
| 개체를 데이터 및 응용 프로그램/x-www-form-url 인코딩된 콘텐츠 유형으로 RestTemplate를 사용하시겠습니까? (0) | 2023.06.28 |