angular-medium-editor icon indicating copy to clipboard operation
angular-medium-editor copied to clipboard

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

Open nikmartin opened this issue 8 years ago • 9 comments
trafficstars

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 avatar Nov 02 '17 16:11 nikmartin

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

nikmartin avatar Nov 02 '17 19:11 nikmartin

not work for me anyone there for help?

usamaa avatar Feb 21 '18 16:02 usamaa

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

thijsw avatar Feb 26 '18 08:02 thijsw

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

shyamal890 avatar Feb 26 '18 15:02 shyamal890

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

thijsw avatar Feb 26 '18 15:02 thijsw

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

shyamal890 avatar Feb 26 '18 17:02 shyamal890

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

thijsw avatar Feb 26 '18 17:02 thijsw

Error in /turbo_modules/@angular/[email protected]/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 avatar Feb 26 '18 17:02 shyamal890

@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

shyamal890 avatar Feb 27 '18 11:02 shyamal890