angularfroala

How to fix Error: Type FroalaEditorModule does not have 'ngModuleDef' property Using Froala Wysiwyg


I'm following the instructions at Angular Froala WYSIWYG Editor and I'm using angular version 8.3.26.

app.nodule...

import { FroalaViewModule, FroalaEditorModule } from 'angular-froala-wysiwyg'

imports: [  
    ...
    FroalaViewModule.forRoot(), FroalaEditorModule.forRoot()
], 

I'm getting and error when I run the application:

Error: Type FroalaEditorModule does not have 'ngModuleDef' property.

How do I fix that?


Solution

  • There is an open BUG #441 in editor's Github repository which does say this is an issue. One of the comment on the issue refers to a fix in Open Pull request and suggests to use the build from the pull request as opposed to using standard npm package.

    So you have 2 options. Either upgrade to Angular 9 or use build from the pull request which I verified works fine!

    In order to use build from pull request follow these steps:

    1. Uninstall editor npm uninstall angular-froala-wysiwyg --save
    2. Install package build from PR npm i leo6104/angular-froala-wysiwyg#feat/ng-packagr-builds --save
    3. Add dependencies:
    npm i froala-editor@3.0.5 --save 
    npm i jasmine-core@>=3.5 --save
    
    1. Run your app ng serve

    enter image description here