Aspnetcore-angular-universal: NodeInvocationException: Can't resolve all parameters for HomeComponent: (?).

Created on 28 Aug 2018  路  1Comment  路  Source: TrilonIO/aspnetcore-angular-universal

Hi good day, have a day try to fix this but i dont know what is the problem.

I only download the latest template and open the solution, fix all the problems with the build but when i run the app i get this error, i dont change anything from the template.

I'm use dotnet sdk 2.1.302

An unhandled exception occurred while processing the request.
NodeInvocationException: Can't resolve all parameters for HomeComponent: (?).
Error: Can't resolve all parameters for HomeComponent: (?).
at syntaxError (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:1270:17)
at CompileMetadataResolver._getDependenciesMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11171:35)
at CompileMetadataResolver._getTypeMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11064:26)
at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:10683:24)
at CompileMetadataResolver._getEntryComponentMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11267:28)
at eval (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11258:31)
at Array.forEach ()
at CompileMetadataResolver._getEntryComponentsFromProvider (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11257:30)
at eval (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11230:138)
at Array.forEach ()
Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.InvokeExportAsync(NodeInvocationInfo invocationInfo, CancellationToken cancellationToken)

Stack Query Cookies Headers
NodeInvocationException: Can't resolve all parameters for HomeComponent: (?).
Error: Can't resolve all parameters for HomeComponent: (?). at syntaxError (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:1270:17) at CompileMetadataResolver._getDependenciesMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11171:35) at CompileMetadataResolver._getTypeMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11064:26) at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:10683:24) at CompileMetadataResolver._getEntryComponentMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11267:28) at eval (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11258:31) at Array.forEach () at CompileMetadataResolver._getEntryComponentsFromProvider (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11257:30) at eval (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11230:138) at Array.forEach ()
Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.InvokeExportAsync(NodeInvocationInfo invocationInfo, CancellationToken cancellationToken)
Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.InvokeExportAsync(CancellationToken cancellationToken, string moduleName, string exportNameOrNull, object[] args)
Microsoft.AspNetCore.NodeServices.NodeServicesImpl.InvokeExportWithPossibleRetryAsync(string moduleName, string exportedFunctionName, object[] args, bool allowRetry, CancellationToken cancellationToken)
Microsoft.AspNetCore.NodeServices.NodeServicesImpl.InvokeExportWithPossibleRetryAsync(string moduleName, string exportedFunctionName, object[] args, bool allowRetry, CancellationToken cancellationToken)
Asp2017.Server.Helpers.HttpRequestExtensions.BuildPrerender(HttpRequest request) in HttpRequestExtensions.cs
+
await Prerenderer.RenderToString(
AspCoreServer.Controllers.HomeController.Index() in HomeController.cs
+
var prerenderResult = await this.Request.BuildPrerender ();
Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments)
System.Threading.Tasks.ValueTask.get_Result()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext)
Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Show raw exception details
Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: Can't resolve all parameters for HomeComponent: (?).
Error: Can't resolve all parameters for HomeComponent: (?).
at syntaxError (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:1270:17)
at CompileMetadataResolver._getDependenciesMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11171:35)
at CompileMetadataResolver._getTypeMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11064:26)
at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:10683:24)
at CompileMetadataResolver._getEntryComponentMetadata (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11267:28)
at eval (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11258:31)
at Array.forEach ()
at CompileMetadataResolver._getEntryComponentsFromProvider (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11257:30)
at eval (webpack-internal:///./node_modules/@angular/compiler/fesm5/compiler.js:11230:138)
at Array.forEach ()
at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.InvokeExportAsyncT
at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.InvokeExportAsyncT
at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.InvokeExportWithPossibleRetryAsyncT
at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.InvokeExportWithPossibleRetryAsyncT
at Asp2017.Server.Helpers.HttpRequestExtensions.BuildPrerender(HttpRequest request) in C:\Users\desar\Desktop\aspnetcore-angular2-universal-master\Server\Helpers\HttpRequestExtensions.cs:line 24
at AspCoreServer.Controllers.HomeController.Index() in C:\Users\desar\Desktop\aspnetcore-angular2-universal-master\Server\Controllers\HomeController.cs:line 15
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.SpaServices.Webpack.ConditionalProxyMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Most helpful comment

Fixed with the before post adding in boot.server and boot.browser this in the second line:
import 'reflect-metadata';

and run -> npm run build:dev

>All comments

Fixed with the before post adding in boot.server and boot.browser this in the second line:
import 'reflect-metadata';

and run -> npm run build:dev

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jrmcdona picture jrmcdona  路  20Comments

MarkPieszak picture MarkPieszak  路  30Comments

johnkattenhorn picture johnkattenhorn  路  15Comments

georgiosd picture georgiosd  路  26Comments

MarkPieszak picture MarkPieszak  路  41Comments