Enabled Ivy and postinstall:"ngcc", facing build duplicate identifier issue for ngx-monaco-editor anf ngx-img-cropper
See original GitHub issueπ bug report
Affected Package
ngx-monaco-editor ngx-img-cropper ag-grid-community.
Is this a regression?
No
Description
I have upgraded angular to 9. Trying to add new Ivy feature, but I am facing duplicate identifier issue for ngx-monaco-editor and ngx-img-cropper and sometimes for ag-grid-community. Then issue occures when adding βngccβ in postinstall script. This issue is getting while building using ng build.
π¬ Reproduction
-
Create new lazy loaded project with angular 9.
-
Enable Ivy from tsconfig.js βangularCompilerOptionsβ: { βenableIvyβ: true },
-
aot from angular.json βoptionsβ: { βaotβ: true, β¦ }
(By default it is enabled for new angular 9 project).
-
Add postinstall script in package.json file βpostinstallβ: βngccβ,
-
run command npm install.
-
build application using ng build
throwing compilation error for ngx-monaco-editor
**ERROR in ./node_modules/ngx-monaco-editor/ivy_ngcc/fesm2015/ngx-monaco-editor.js 9:12 Module parse failed: Identifier βΙ΅ngcc0β has already been declared (9:12) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | import * as Ι΅ngcc0 from β@angular/coreβ; |
import * as Ι΅ngcc0 from β@angular/coreβ; | | const _c0 = [βeditorContainerβ];**
and Error for ngx-img-cropper **ERROR in ./node_modules/ngx-img-cropper/ivy_ngcc/fesm2015/ngx-img-cropper.js 8:12 Module parse failed: Identifier βΙ΅ngcc0β has already been declared (8:12) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | import * as Ι΅ngcc1 from β@angular/commonβ; |
import * as Ι΅ngcc0 from β@angular/coreβ;**
π₯ Exception or Error
ERROR in ./node_modules/ngx-img-cropper/__ivy_ngcc__/fesm2015/ngx-img-cropper.js 8:12
Module parse failed: Identifier 'Ι΅ngcc0' has already been declared (8:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import * as Ι΅ngcc1 from '@angular/common';
|
> import * as Ι΅ngcc0 from '@angular/core';
|
| const _c0 = ["cropcanvas"];
@ ./src/app/shared/common/sub-app-common.module.ts 6:0-53 100:12-30 170:8-26 237:20-38
@ ./src/app/app-routing.module.ts
@ ./src/app/app.module.ts
@ ./src/root.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/ngx-monaco-editor/__ivy_ngcc__/fesm2015/ngx-monaco-editor.js 9:12
Module parse failed: Identifier 'Ι΅ngcc0' has already been declared (9:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import * as Ι΅ngcc0 from '@angular/core';
|
> import * as Ι΅ngcc0 from '@angular/core';
|
| const _c0 = ["editorContainer"];
@ ./src/app/admin/libraries/libraries.module.ts 115:0-55 141:0-40 187:12-30 305:25-46 351:20-38
@ ./src/app/admin/admin-routing.module.ts
@ ./src/app/admin/admin.module.ts
@ ./src/app/app-routing.module.ts
@ ./src/app/app.module.ts
@ ./src/root.module.ts
@ ./src/main.ts
@ multi ./src/main.ts
π Your Environment
Angular Version:
PS C:\MyData\TCSrc\Client> ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ β³ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 9.1.1
Node: 12.16.2
OS: win32 x64
Angular: 9.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router
Ivy Workspace: <error>
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.901.2
@angular-devkit/build-angular 0.901.2
@angular-devkit/build-optimizer 0.901.2
@angular-devkit/build-webpack 0.901.2
@angular-devkit/core 9.1.2
@angular-devkit/schematics 9.1.1
@angular/cdk 9.2.1
@ngtools/webpack 9.1.2
@schematics/angular 9.1.1
@schematics/update 0.901.1
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
PS C:\MyData\TCSrc\Client>
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (6 by maintainers)
I believe this is a known issue with angular-formio. See https://github.com/formio/angular-formio/issues/505
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.