Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 9 Support #378

Open
doroncy opened this issue Feb 16, 2020 · 16 comments · May be fixed by #396
Open

Angular 9 Support #378

doroncy opened this issue Feb 16, 2020 · 16 comments · May be fixed by #396

Comments

@doroncy
Copy link

doroncy commented Feb 16, 2020

When building a library with Angular 9, I get the following error

Compiling TypeScript sources through ngc
ERROR: node_modules/angular-froala-wysiwyg/editor/editor.module.d.ts:3:23 - error NG6005: FroalaEditorModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.

looks like the editor ModuleWithProviders does not contain a type definition.

@1-0-1
Copy link

1-0-1 commented Mar 27, 2020

With Angular 9.1 I am getting the following error:
ERROR: node_modules/angular-froala-wysiwyg/editor/editor.directive.d.ts:37:18 -
error TS2314: Generic type '??FactoryDef' requires 2 type argument(s).

37 static ?fac: ?ngcc0.??FactoryDef;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/angular-froala-wysiwyg/view/view.directive.d.ts:9:18 - error TS2314
: Generic type '??FactoryDef' requires 2 type argument(s).

9 static ?fac: ?ngcc0.??FactoryDef;

@d3skdev
Copy link

d3skdev commented Apr 5, 2020

try to reinstall froala package again

npm install
npm install angular-froala-wysiwyg@latest
ng build --prod --aot

@sheshnathverma
Copy link

I have stuck with this error from three months and I'm not able to build my app for production so plz provide update and ETA.

image

antonellopasella added a commit to antonellopasella/angular-froala-wysiwyg that referenced this issue May 6, 2020
@antonellopasella antonellopasella linked a pull request May 6, 2020 that will close this issue
@blingerson
Copy link

blingerson commented Jun 3, 2020

I also ran into the same issue as @sheshnathverma. Both the FroalaEditorModule and FroalaViewModule need the generics added. In addition the FroalaEditorDirective imports Renderer which obviously no longer exists in @angular/core v9.x. I have tried to publish a fork with these three fixes, but IVY still doesn't appear to compile correctly with ngcc as I get the following error after making the above changes:

error NG6002: Appears in the NgModule.imports of FroalaModule, but could not be resolved to an NgModule class.

This likely means that the library (angular-froala-wysiwyg-ivy) which declares FroalaEditorModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

What is the roadmap for Angular 9 / Ivy support for angular-froala-wysiwyg?

You can see my changes which may fix the issue here:

https://github.com/blingerson/angular-froala-wysiwyg/commits/master

@ngrunfeld
Copy link

Same Issue here

@steve-tapley
Copy link

FYI, version 2.9.8 works fine with Angular 9.1

@blingerson
Copy link

@steve-tapley it does not work when IVY is enabled, it only works with angular 9 when IVY is disabled (which is non-default).

The three issues mentioned above prevent it from running with IVY enabled.

@steve-tapley
Copy link

@blingerson We are using V2.9.8 in angular 9.1 with Ivy enabled.
V2.9.6 and earlier did not support angular 9

@blingerson
Copy link

blingerson commented Jun 7, 2020

@steve-tapley, v2.9.8 does not compile in our app. The bugs are still in the master branch:

  1. public static forRoot(): ModuleWithProviders {
    as you can see this will throw a type error because public static forRoot(): ModuleWithProviders { should be public static forRoot(): ModuleWithProviders<FroalaEditorModule> {
  2. public static forRoot(): ModuleWithProviders {
    similarly public static forRoot(): ModuleWithProviders { should be public static forRoot(): ModuleWithProviders<FroalaViewModule> { and it is currently throwing a type error.
  3. import { Directive, ElementRef, EventEmitter, Input, NgZone, Optional, Output, Renderer, forwardRef } from '@angular/core';
    this is importing Render which does not exist with IVY. All three fo these issues fail type checking and one completely errors out because when IVY is enabled it cannot import Renderer.

Perhaps you haven't check with the latest angular code? I can assure you that, in my situation, along with others here it definitely does not support angular 9. I got our app working by copying the directives and modules into our codebase and fixing the above issues. We are using angular 9.1.7.

@blingerson
Copy link

@steve-tapley you may also want to check with:

import { ɵivyEnabled as ivyEnabled } from '@angular/core';

Many custom webpack configurations seem like ivy is enabled, but this "ivyEnabled" flag ends up being false. It should be true in both development and production mode. You may want to give it a sanity check to make sure it is truly enabled in your testcase.

@blingerson
Copy link

@steve-tapley I have created a pull request with the pertinent changes:

#400

It is very possible that since we and others here are using custom webpack configurations that these issues could be due to different tsconfig or webpack loaders. Please consider this pull request to alleviate those issues in the cases where people are having issues. Thanks.

@pxcT
Copy link

pxcT commented Jul 22, 2020

Any updates about this ?

@blingerson
Copy link

It would be great to get the fixes in so we can remove our hacks and get this working with Angular 9. Is there anything I can do to help facilitate getting my pull request merged in?

@vdsheryarshirazi
Copy link

any update on this?

@blingerson
Copy link

blingerson commented Dec 7, 2020

Sorry for not circling back on this sooner, but I just removed my hack and installed v3.2.3 which has my pull request I believe. All is working fine and this issue seems like it can be closed. Thanks!

@DoanVanThuong
Copy link

DoanVanThuong commented Jul 9, 2023

any update on this, i getting this error in angular 11
"angular-froala-wysiwyg": "^2.8.1",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants