question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. Create new lazy loaded project with angular 9.

  2. Enable Ivy from tsconfig.js β€œangularCompilerOptions”: { β€œenableIvy”: true },

  3. aot from angular.json β€œoptions”: { β€œaot”: true, … }

(By default it is enabled for new angular 9 project).

  1. Add postinstall script in package.json file β€œpostinstall”: β€œngcc”,

  2. run command npm install.

  3. 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:closed
  • Created 3 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
petebacondarwincommented, Apr 30, 2020

I believe this is a known issue with angular-formio. See https://github.com/formio/angular-formio/issues/505

0reactions
angular-automatic-lock-bot[bot]commented, Jun 24, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 13 Update "Duplicate identifier" Error - Stack Overflow
I changed the angularCompilerOptions to use "compilatonMode": "partial" and removed the option "enableIvy": false , released a new version but IΒ ...
Read more >
Jasmine collision with Mocha (backend), Duplicate identifier ...
I have a project with angular in the frontend and node (firebase) in the backend. Using the default angular testing setup with jasmine...
Read more >
karma-coverage | Generate code coverage | Plugin library
Implement karma-coverage with how-to, Q&A, fixes, code snippets. kandi ratings - Medium support, No Bugs, No Vulnerabilities. Permissive License, Build ...
Read more >
Managing ambient type definitions and dealing with the ...
Duplicate identifier 'export='. ... is quite likely to not find the possible issue in our code base even after we deploy it to...
Read more >
Fix TS2300 Duplicate identifier error in TypeScript with React
Have you updated your "react" and "@types/react" dependencies and now see error TS2300 and TS2717? Let me help you understand and fix theseΒ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found