Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Call to Node module failed with error: If you use aspnet-prerendering >= 2.0.0, you must update your server-side boot module to call createServerRenderer. Either update your boot module code, or revert to aspnet-prerendering version 1.x #479

Closed

Description

@lruckman

Using package: Microsoft.AspNetCore.SpaServices (1.1.0-beta-000002)

Following the Microsoft.AspNetCore.SpaServices readme to install into an existing project (which is just a new .NET Core Web Application) and I get as far as step 3. Once I've added the JS file and refresh the page I get the below exception.

System.Exception: Call to Node module failed with error: If you use aspnet-prerendering >= 2.0.0, you must update your server-side boot module to call createServerRenderer. Either update your boot module code, or revert to aspnet-prerendering version 1.x at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.<InvokeExportAsync>d__71.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.<InvokeExportAsync>d__131.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.<InvokeExportWithPossibleRetryAsync>d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.AspNetCore.SpaServices.Prerendering.PrerenderTagHelper.<ProcessAsync>d__33.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at AspNetCore._Views_Home_Index_cshtml.<ExecuteAsync>d__28.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Razor.RazorView.<RenderPageAsync>d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Razor.RazorView.<RenderAsync>d__13.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.<ExecuteAsync>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.ViewResult.<ExecuteResultAsync>d__26.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeResultAsync>d__30.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextResultFilterAsync>d__28.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResultExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextResourceFilter>d__22.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAsync>d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()

Activity

  1. SteveSandersonMS commented on Dec 1, 2016

    @SteveSandersonMS
    Member

    Thanks for reporting this. I've updated the docs to account for the changed APIs in aspnet-prerendering 2.0.0.

  2. lruckman commented on Dec 1, 2016

    @lruckman
    Author

    Works great thanks!

  3. danielwhymark commented on Jan 9, 2017

    @danielwhymark

    Hi - Any ETA re 1.1.0-beta-000003 to include this fix?

  4. SteveSandersonMS commented on Jan 9, 2017

    @SteveSandersonMS
    Member

    @danielwhymark This was a fix to the docs, which is already live. They now specify how to write your boot module so as to be compatible with aspnet-prerendering 2.0+: 2b2465a. It's a very simple change you'll need to make like in the diffs in that commit.

    If you don't want to change your boot module code to account for this, you'll need to revert to aspnet-prerendering 1.x as per the error message. Hope that's OK!

  5. ParkourKarthik commented on Feb 22, 2017

    @ParkourKarthik

    I'm still facing the error even after following the Updated docs.
    "aspnet-prerendering": "^2.0.3"
    image

  6. MarkPieszak commented on Feb 22, 2017

    @MarkPieszak
    Contributor

    Did you try wiping out node_modules and re-installing, if it's not defined you might still have the old one in there. @ParkourKarthik

    rimraf ./node_modules/aspnet-prerendering && npm i

  7. ParkourKarthik commented on Feb 22, 2017

    @ParkourKarthik

    If I am not wrong, I already compared with the latest source and it was similar: https://github.com/aspnet/JavaScriptServices/blob/dev/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/src/Prerendering.ts

    Also, as per your advice, I tried wiping the package and re-installed it. But still no clue. @MarkPieszak

  8. MarkPieszak commented on Feb 22, 2017

    @MarkPieszak
    Contributor

    In your server webpack vendor config, is there an entry there for aspnet-prerendering as well?
    https://github.com/MarkPieszak/aspnetcore-angular2-universal/blob/fa00f9269b1d00c274710cfa28ce9615b7ef1e89/webpack.config.vendor.js#L107

  9. ParkourKarthik commented on Feb 22, 2017

    @ParkourKarthik

    @MarkPieszak No, there is no entry for aspnet-prerendering.

    I tried after adding the entry, even replacing the whole webpack.config.vendor.js that is mentioned. No change in the error.
    I'm thinking of downgrading to the older version as preferred in the alternative.

  10. danielwhymark commented on Feb 22, 2017

    @danielwhymark

    After checking the changes carefully, project.json, deleting node modules - got it working after rebuilding webpack config as below:

    webpack --config webpack.config.vendor.js
    webpack

  11. ParkourKarthik commented on Feb 23, 2017

    @ParkourKarthik

    @danielwhymark Very much useful. I tried that and fixed the missing webpack changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions