question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Angular 10.1.2] Error:Unexpected value 'LibraryModule in[..] imported by module.ts. Please add a @ngModule.annonation.

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/....

Angular CLI: 10.1.2 Node: 10.16.0 OS: linux x64

Angular: 10.1.2 … animations, cli, common, compiler, compiler-cli, core, forms … platform-browser, platform-browser-dynamic, router Ivy Workspace: No

Package Version

@angular-devkit/architect 0.1001.2 @angular-devkit/build-angular 0.1001.2 @angular-devkit/build-ng-packagr 0.1001.2 @angular-devkit/core 10.1.2 @angular-devkit/schematics 10.1.2 @angular/cdk 10.2.1 @angular/material 10.1.1 @schematics/angular 10.1.2 @schematics/update 0.1001.2 ng-packagr 9.0.0 rxjs 6.6.3 typescript 4.0.2

Is this a regression?

Yes Angular 8 was working fine. Yes, the previous version in which this bug was not present was: ....

Description

I have library module which is upgraded to angular 10.1.2 from angular 8.1.2. with enableIvy:false i have created the prod build. Upon using the library module into another application which is also upgraded angular 10.1.2 application i am getting the error.

A clear and concise description of the problem...

πŸ”¬ Minimal Reproduction

https://stackblitz.com/...

πŸ”₯ Exception or Error




ERROR: Unexpected value 'LibraryModule in /home/my-app/node_modules/@mylib/ui-libs/libs/library.module.d.ts' imported by the module 'SharedlibModule in /home/my-app/projects/sharedlib/src/lib/sharedlib.module.ts'. Please add a @NgModule annotation.
Can't bind to 'formConfig' since it isn't a known property of myapp-dynamic-form'.
1. If β€˜myapp-dynamic-form' is an Angular component and it has 'formConfig' input, then verify that it is part of this module.
2. If β€˜myapp-dynamic-form' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

🌍 Your Environment

Angular Version:




Angular CLI: 10.1.2
Node: 10.16.0
OS: linux x64

Angular: 10.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: No

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1001.2
@angular-devkit/build-angular      0.1001.2
@angular-devkit/build-ng-packagr   0.1001.2
@angular-devkit/core               10.1.2
@angular-devkit/schematics         10.1.2
@angular/cdk                       10.2.1
@angular/material                  10.1.1
@schematics/angular                10.1.2
@schematics/update                 0.1001.2
ng-packagr                         9.0.0
rxjs                               6.6.3
typescript                         4.0.2

Anything else relevant?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
petebacondarwincommented, Nov 2, 2020

@justinwilaby - the library that you are depending upon has been published (invalidly) after being compiled via Ivy. This is not supported. The ngx-file-drop library must be built in ViewEngine compiler mode before being published. Then you can also build your library in ViewEngine mode.

The problem is therefore with the author of the ngx-file-drop library who should not have published a library built with Ivy. Closing as this is working as expected from the Angular compiler side of things.

0reactions
angular-automatic-lock-bot[bot]commented, Dec 3, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular error: Please add a @NgModule annotation
You're trying to "import" a component in SomeModule . imports: [ CommonModule, SomeComponent ],. You import modules and declare components,Β ...
Read more >
NgModules - Angular
Imports other modules with the components, directives, and pipes that components in the current module need; Provides services that other application componentsΒ ...
Read more >
Import MDB Pro into Angular library - MDBootstrap
My library module file import { NgModule } from '@angular/core'; import { ZontallyCommonComponent } from './zontally-common.component'; import ...
Read more >
Angular CLI - Please add a @NgModule annotation when ...
compiler.es5.js:1689 Uncaught Error: Unexpected directive 'ProjectsListComponent' imported by the module 'ProjectsModule'. Please add a @NgModule annotation ...
Read more >
Javascript – Unexpected value '…' imported by the module ...
Please add a @NgModule annotation. angularjavascript. Using Angular. ... compiler.es5.js:1540 Uncaught Error: Unexpected value 'BoxModule' imported by theΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found