Angular2 forms error when using JavaScriptServices/Universal #1051

Closed
opened 2025-08-09 17:18:41 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @bencameron00 on 2/6/2017

The problem that I am having is that I get a runtime error if I have a form in a component.

I am importing both FormsModule and ReactiveFormsModule.

My form looks like this...

<form (ngSubmit)="onSubmit()" #loginForm="ngForm" >
...
</form>

The error I am getting is...

Exception: Call to Node module failed with error: Prerendering failed because of error: TypeError: _angular_core.InjectionToken is not a constructor at C:\XXX\ClientApp\dist\main-server.js:35055:42

What have I missed? My form setup worked perfectly when I was not using the JavaScriptServices starter for server side rendering.

*Originally created by @bencameron00 on 2/6/2017* The problem that I am having is that I get a runtime error if I have a form in a component. I am importing both FormsModule and ReactiveFormsModule. My form looks like this... ``` <form (ngSubmit)="onSubmit()" #loginForm="ngForm" > ... </form> ``` The error I am getting is... > Exception: Call to Node module failed with error: Prerendering failed because of error: TypeError: _angular_core.InjectionToken is not a constructor at C:\XXX\ClientApp\dist\main-server.js:35055:42 What have I missed? My form setup worked perfectly when I was not using the JavaScriptServices starter for server side rendering.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1051
No description provided.