You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't import FormsModule nor ReactiveFormsModule #13432
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[x] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
I'm trying to import and inject the form modules...
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@NgModule({
imports: [
UniversalModule, // Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too.
FormsModule,
ReactiveFormsModule,
AppRoutingModule,
CampaignModule,
SharedModule
],
declarations: [
AppComponent,
NavMenuComponent,
HomeComponent
],
bootstrap: [ AppComponent ]
})
export class AppModule {}
Error Message:
forms.umd.js:5596 --- Uncaught TypeError: _angular_core.Version is not a constructor
Expected behavior
Working. Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
@DzmitryShylovich I don't have @angular/compiler-cli as an npm dependency.
I added it and it didn't resolve the issue. I've included my ng2 dependencies below. Also, it is only when importing the @angular/forms module that it breaks my app and displays that error message. If I don't import ng2/forms my application works fine.
@chuckjaz I'm going to close this issue. Ended up migrating our application to an angular-cli generated one. We are pretty early in the lifecycle of our project and decided to switch to a clean slate. Thanks for your response.
After updating to a newer version of angular i got the error as well.
Uncaught TypeError: _angular_core.Version is not a constructor
at forms.umd.js:5653
at Object.defineProperty.get (forms.umd.js:7)
at Object. (forms.umd.js:10)
at webpack_require (bootstrap 2c60a49…:555)
at fn (bootstrap 2c60a49…:86)
at Object. (app.module.ts:4)
at webpack_require (bootstrap 2c60a49…:555)
at fn (bootstrap 2c60a49…:86)
at Object. (boot-client.ts:5)
at Object. (boot-client.ts:23)
While testing i tried to create a temporary workarround by changing the faulting line to something like that.
var /** @type {?} */ VERSION = '2.4.1'; //new _angular_core.Version('2.4.1');
@tweichselbaumer @nabokov-ef This issue doesn't appear to be related to the original issue. Can one of you create a separate issue to track this problem?
After some research I think I have found the problem. I'm using Angular Universal. This module is currently not compartible with the newer versions of angular. 2.2.x will work with a workaround but 2.3.0+ not. I read somewhere that they want to merge angular universal into the main angular repository. Hopefully that will solve our problems.
Reacted by Ben
angular-automatic-lock-bot commented on Sep 10, 2019
Activity
DzmitryShylovich commentedon Dec 13, 2016
Looks similar to #13342 (comment)
iglesias-soltech commentedon Dec 13, 2016
@DzmitryShylovich I don't have @angular/compiler-cli as an npm dependency.
I added it and it didn't resolve the issue. I've included my ng2 dependencies below. Also, it is only when importing the @angular/forms module that it breaks my app and displays that error message. If I don't import ng2/forms my application works fine.
Thanks for your help,
Michael
chuckjaz commentedon Dec 15, 2016
@iglesias-soltech We released 2.3.1. Can you test against it, restoring your
compiler-clidependency to~2.3.0?iglesias-soltech commentedon Dec 15, 2016
@chuckjaz I'm going to close this issue. Ended up migrating our application to an angular-cli generated one. We are pretty early in the lifecycle of our project and decided to switch to a clean slate. Thanks for your response.
dguisinger commentedon Dec 27, 2016
Please re-open this issue, I am getting this as well with 2.4.0 and 2.4.1.
tweichselbaumer commentedon Jan 1, 2017
Hi, im new in angular 2. I started with the VS2015 .net core angular 2 template. http://blog.stevensanderson.com/2016/10/04/angular2-template-for-visual-studio/
After updating to a newer version of angular i got the error as well.
While testing i tried to create a temporary workarround by changing the faulting line to something like that.
var /** @type {?} */ VERSION = '2.4.1'; //new _angular_core.Version('2.4.1');This results in an other error:
I don't know, but maybe it was caused by my dirty try to create a workarround or it is also related with the previeous error.
My packages:
evgeni-nabokov commentedon Jan 6, 2017
I have the same problem as @tweichselbaumer has.
A screen with the error: https://1drv.ms/i/s!AoHobQYmOKNGn7wRWD4DKZyP6Ksfig
Package list: http://pastebin.com/fBJt1msf
chuckjaz commentedon Jan 6, 2017
@tweichselbaumer @nabokov-ef This issue doesn't appear to be related to the original issue. Can one of you create a separate issue to track this problem?
tweichselbaumer commentedon Jan 8, 2017
After some research I think I have found the problem. I'm using Angular Universal. This module is currently not compartible with the newer versions of angular. 2.2.x will work with a workaround but 2.3.0+ not. I read somewhere that they want to merge angular universal into the main angular repository. Hopefully that will solve our problems.
angular-automatic-lock-bot commentedon Sep 10, 2019
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.