ng2-ace-editor icon indicating copy to clipboard operation
ng2-ace-editor copied to clipboard

It does not work with angular 8.0.0 and ivy enabled

Open sysmat opened this issue 5 years ago • 7 comments

when trying to build I got error, it is a stopper

WARNING in Entry point 'ng2-ace-editor' contains deep imports into 'brace/theme/monokai'. This is probably not a problem, but may cause the compilation of entry points to be out of order.

ERROR in node_modules/ng2-ace-editor/src/module.d.ts(1,22): error TS-996002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

sysmat avatar Jun 03 '19 06:06 sysmat

I created a fork from this repo and upgraded it to Angular 9 , it should work

https://www.npmjs.com/package/ngx-ace-editor-wrapper

This is the exact same ng2-ace-editor just pumped to A9

martinpagesaal avatar Feb 14 '20 18:02 martinpagesaal

Hello martinpagesaal, we use the 'ng2-ace-editor' aswell but got the same problems mentioned above after updating to angular 9 and enabling ivy. I tried to update to the 'ngx-ace-editor-wrapper' but I can't compile the project due to the following errors:

node_modules/ngx-ace-editor-wrapper/dist/src/directive.d.ts:37:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).

static ɵfac: i0.ɵɵFactoryDef<AceEditorDirective>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ node_modules/ngx-ace-editor-wrapper/dist/src/component.d.ts:49:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).

static ɵfac: i0.ɵɵFactoryDef<AceEditorComponent>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ node_modules/ngx-ace-editor-wrapper/dist/src/component.d.ts:50:18 - error TS2314: Generic type 'ɵɵComponentDefWithMeta' requires 7 type argument(s).

static ɵcmp: i0.ɵɵComponentDefWithMeta<AceEditorComponent, "ace-editor", never, { "style": "style"; "options": "options"; "readOnly": "readOnly"; "theme": "theme"; "mode": "mode"; "value": "value"; "text": "text"; "autoUpdateContent": "autoUpdateContent"; "durationBeforeCallback": "durationBeforeCallback"; }, { "textChanged": "textChanged"; "textChange": "textChange"; }, never>;

Wyomi7 avatar Apr 08 '20 11:04 Wyomi7

Same problem for me. I tried to update to 'ngx-ace-editor-wrapper' but I can't compile the project due to the above mentioned errors. @martinpagesaal

sujithmathewthomas avatar Apr 08 '20 13:04 sujithmathewthomas

looks like it should compile correctly upgrading to angular 9.1 https://stackoverflow.com/questions/60898133/angular-9-ivy-generic-type-%C9%B5%C9%B5factorydef-requires-2-type-arguments

huineng avatar Apr 20 '20 14:04 huineng

looks like it should compile correctly upgrading to angular 9.1 https://stackoverflow.com/questions/60898133/angular-9-ivy-generic-type-%C9%B5%C9%B5factorydef-requires-2-type-arguments

I followed the steps from the thread, but I still get the same errors. The only way to compile the project for now is to set "skipLibCheck":true in the tsconfig.json.

Wyomi7 avatar Apr 21 '20 08:04 Wyomi7

Had the same issue with angular 10.0.5 today when using https://www.npmjs.com/package/ngx-ace-editor-wrapper (see above). Just in case someone else has the same problem: I fixed it by making the following changes to the code:

node_modules/ngx-ace-editor-wrapper/dist/src/component.d.ts:

static ɵfac: i0.ɵɵFactoryDef<AceEditorComponent, never>;
static ɵcmp: i0.ɵɵComponentDefWithMeta<AceEditorComponent, "ace-editor", never, { "style": "style"; "options": "options"; "readOnly": "readOnly"; "theme": "theme"; "mode": "mode"; "value": "value"; "text": "text"; "autoUpdateContent": "autoUpdateContent"; "durationBeforeCallback": "durationBeforeCallback"; }, { "textChanged": "textChanged"; "textChange": "textChange"; }, never, never>;

node_modules/ngx-ace-editor-wrapper/dist/src/directive.d.ts:

static ɵfac: i0.ɵɵFactoryDef<AceEditorDirective, never>;

robert-bauer avatar Aug 10 '20 15:08 robert-bauer

Hi guys, I made it work for my project and didn't went deeper into it.

this is how I'm using it right now, this is part of my package.json hope it helps

"dependencies": {
    "@angular-devkit/schematics-cli": "^0.901.6",
    "@angular/animations": "9.0.1",
    "@angular/cdk": "9.0.0",
    "@angular/common": "9.0.1",
    "@angular/compiler": "9.0.1",
    "@angular/core": "9.0.1",
    "@angular/flex-layout": "^9.0.0-beta.29",
    "@angular/forms": "9.0.1",
    "@angular/material": "^9.0.0",
    "@angular/material-moment-adapter": "9.0.0",
    "@angular/platform-browser": "9.0.1",
    "@angular/platform-browser-dynamic": "9.0.1",
    "@angular/router": "9.0.1",
...
    "ace-builds": "1.4.3",
...
    "ngx-ace-editor-wrapper": "^9.0.1",
....
  },

martinpagesaal avatar Sep 08 '20 00:09 martinpagesaal