Please add a @Pipe/@Directive/@Component annotation
ceejeeb opened this issue · 10 comments
Hello i am getting the above error when trying to build my app using angular 4.4.3.
It builds and runs fine in developer mode but fails to build in prod.
I know this has been raised before but if you are sure this isn't a problem with your package can you provide an example cli project that builds in prod mode?
@ceejeeb, thanks for the feedbacks. The truth is that I have never run the code with this directive in the product mode when I do:
import { ContenteditableDirective } from 'ng-contenteditable';
For prod mode, I just copy and paster this into a separate file as a direcrive.
I will now try to solve this problem.
if it helps i found importing the directive like this:
import { ContenteditableDirective } from '../../node_modules/ng-contenteditable/src/index';
rather than:
import { ContenteditableDirective } from 'ng-contenteditable';
works.
So I think the problem is in your dist folder
@ceejeeb, please update ng-contenteditable
to v1.0.3, should now work in prod mode too.
@ceejeeb, can I close this issue. ng-contenteditable
now works without errors in -prod
mode for you?
i am still having this issue in v1.0.5. i'm ussing (AppVeyor)[https://www.appveyor.com/] to build my app. here's the error:
ERROR in : Unexpected value 'ContenteditableDirective in C:/projects/{myProject}/node_modules/ng-contenteditable/dist/index.d.ts' declared by the module 'AppModule in C:/projects/{myProject}/src/app/app.module.ts'. Please add a @Pipe/@Directive/@component annotation.
my app.module.ts has:
import {ContenteditableDirective} from 'ng-contenteditable/dist';
@rrrafalsz , try
import { ContenteditableDirective } from 'ng-contenteditable';
@KostyaTretyak importing from ng-contenteditable
isntead of ng-contenteditable/dist
causes this error in building for production
Module build failed: Error: node_modules/ng-contenteditable/src/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:708:23)
at plugin.done.then (node_modules/@ngtools/webpack/src/loader.js:41:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
@jacobbullock, yes, see #9
Unexpected module 'ReactiveFormsModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@component annotation.
how to remove error
@atulawari, how does this relate to this module?