thijsw / angular-medium-editor

AngularJS directive for Medium.com editor clone
303 stars 94 forks source link

Library stopped working on latest 4.x and 5.x angular #82

Open nikmartin opened 6 years ago

nikmartin commented 6 years ago

ERROR in Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 404:52 in the original .ts file), resolving symbol Directive in /home/nmartin/Projects/classconnect/classconnect-web/node_modules/angular-medium-editor/node_modules/@angular/core/core.d.ts, resolving symbol MediumEditorDirective in /home/nmartin/Projects/classconnect/classconnect-web/node_modules/angular-medium-editor/medium-editor.directive.ts, resolving symbol MediumEditorDirective in /home/nmartin/Projects/classconnect/classconnect-web/node_modules/angular-medium-editor/medium-editor.directive.ts

This is common across a lot of libraries right now, and supposedly it's because your d.ts doesn't export the'proper' metadata for angular to do AOT compilation, which is default now.

Ref: https://github.com/angular/angular-cli/issues/3707 and https://medium.com/@cyrilletuzi/how-to-build-and-publish-an-angular-module-7ad19c0b4464

nikmartin commented 6 years ago

I imported medium-editor.directive.ts directly into my project, and it works fine.

usamaa commented 6 years ago

not work for me anyone there for help?

thijsw commented 6 years ago

@nikmartin Would you be willing to create a PR to resolve this?

shyamal890 commented 6 years ago

Following... just wondering if I should install the pre-release version v4.0.0 alpha.

thijsw commented 6 years ago

@shyamal890 Yes for the latest versions of Angular it is preferred, care to test it out? And report back the results

shyamal890 commented 6 years ago

Not able to make it work here: https://stackblitz.com/edit/angular-medium-editor

thijsw commented 6 years ago

@shyamal890 Can you try using the pre-release as a dependency?

shyamal890 commented 6 years ago
Error in /turbo_modules/@angular/compiler@5.0.0/bundles/compiler.umd.js (509:34)
Unexpected value 'MediumEditorDirective' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.
Evaluating main.ts
Booting application
shyamal890 commented 6 years ago

@thijsw Sorry I even tried importing the directive directly it gives error saying MediumEditor is not a constructor. https://stackblitz.com/edit/angular-medium-editor-custom-import