-
Notifications
You must be signed in to change notification settings - Fork 12k
No Directive annotation found on when working with NPM linked modules #1514
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
Comments
I have the same problem. Any advice how to solve it? |
This error threw me for a loop. Very annoying but my workaround is to |
I ran into this problem too. I believe it is cause reflect-metadata isn't getting pulled in correctly, so it isn't reading the annotations as expected. Peer dependancy issue The only way I can seem to get around this issue is a weird npm dance of sorts.
Sometimes, I would have to do the same for to relink to the package name. When I used the install by localPath, it would not pick changes to the files. I would have to run npm install localpath again. I'm thinking of setting a small gulp task for this to watch. Does anyone have another thought? |
I don't think there is anything we CAN do about this scenario really. It's a NPM issue of sorts. Basically, if you link a package, NPM doesn't dedupe it's dependencies... which is what you want really, otherwise you can't continue development on the linked package. In the Angular 2 case, it DOES mean that there are two sets of And that messes up dependency injection. It messes it up bad. I'll leave the issue open for now to see if someone comes up with more useful information about this topic. But, unless my understanding of the issue is severely flawed, I don't see this as a CLI issue. |
One solution that worked for me in prototyping, was explicitly listing all relevant modules within the alias element of the webpack config. Maybe this could be made configurable? This might help as well: https://github.com/thebeansgroup/webpack-link |
Same here, if I use it directly with npm link it gives me "No Directive annotation found on XYZ" . What is the suggested way to solve this issue ? |
Closing as it's not a CLI issue, and nothing else came up so far. The CLI is not going to alias modules to prevent these problems as they are npm considerations. |
It seems like the best solution when developing a component is to have a demo page and to not rely on developing the extension in an external application. If that is needed a develop could probably setup a gulp task or something to watch and copy the component files automatically on change instead of relying on linking. Running |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When trying to combine development of a npm linked component library and the latest webpack build there is a potential to get the error
No Directive annotation found on MyModule
. This is due to the fact that Webpack is picking up@angular/core
in thenode_modules
directory of the component library in addition to the modules in the cli generated application.Desired behavior would be for the CLI to ignore packages of the same version regardless of location.
The text was updated successfully, but these errors were encountered: