Aspnetcore-angular-universal: Exception: Call to Node module failed with error

Created on 11 May 2017  ·  10Comments  ·  Source: TrilonIO/aspnetcore-angular-universal

Excuse my English

I have had several problems using this template, some solved with these commands:

npm rebuild node-sass
npm run build: dev

Other times I delete the folder node_modules and execute npm install and commands again

But it is very complicated that from one moment to another without making any changes in the code begin to emerge errors

Now the problem is this:

"An unhandled exception occurred while processing the request.

Exception: Call to Node module failed with error: Prerendering timed out after 30000ms because the boot function in '../Client/dist/main-server' returned a promise that did not resolve or reject. Make sure that your boot function always resolves or rejects its promise. You can change the timeout value using the 'asp-prerender-timeout' tag helper."

I am very frustrated, because I have hours, maybe days with these problems and none is for my code ... explain this to your boss ...

Anyway ... thanks and I hope to move on with this

FAQ

All 10 comments

I'm having the same issue. Spent the past two days trying to configure my development environment to get this project to build and run and haven't made much headway...Your instructions say that you can open the project in "VS 2017 and simply push F5 to start debugging", but all of my web requests fail with the message "Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x. Found bindings for the following environments: Windows 64-bit with Node.js 5.x". I've tried rebuilding node-sass, reinstalling node modules, and a bunch of other things and nothing I do has allowed the server app to respond to http requests. The project looks like a promising way to bootstratp an Angular 4.x / ASP.Net project, but it would be helpful include instructions on how to configure your dev environment for newbies like myself.

Jesus Christ

In my case, this error was coming out of a comment from a .css file of a component

Apparently webpack when loading the css does not exclude the lines that are comments ... the solution was to delete the comments

Now I have another problem

I create a component and add some html, then compile webpack and everything without problems, I execute the project and the HTML looks good, renders well

But when I log in to developer tools I see this error

error

I think it's related to [HMR] ...

The strange thing is that when I change my html for something very simple, like

<h1>component</h1>

Fixed bug in developer tools

@cristiancamiloperezlopez at this point I'm thinking it'll be easier to start a project from scratch rather than trying to re-configure my environment to accommodate this solution.

I have the same issue. (node 7.10, npm 4,2.0)
There are too many errors:

[email protected] build:dev C:UsersJürgenDocumentsVisual Studio 2017Projectsaspnetcore-angular2-universal-master
webpack --progress --color

Hash: 3956f0e8ecb585519ac22666bfe356e8649d4d46
Version: webpack 2.5.1
Child
Hash: 3956f0e8ecb585519ac2
Time: 27472ms
Asset Size Chunks   Chunk Names
0.js 3.3 kB 0 [emitted]
main-browser.js 3.99 MB 1 [emitted] [big] main-browser
0.js.map 1.51 kB 0 [emitted]
main-browser.js.map 4.75 MB 1 [emitted] main-browser
[1] ./~/@angular/core/@angular/core.es5.js 467 kB {1} [built]
[3] ./~/rxjs/Observable.js 5.64 kB {1} [built]
[30] ./~/rxjs/Subject.js 5.61 kB {1} [built]
[31] ./~/@angular/platform-browser/@angular/platform-browser.es5.js 142 kB {1} [built]
[76] (webpack)/buildin/global.js 509 bytes {1} [built]
[79] ./Client/app/shared/constants/baseurl.constants.ts 153 bytes {1} [built]
[126] ./~/ng2-signalr/index.js 524 bytes {1} [built]
[141] ./Client async 160 bytes {1} [built]
[143] ./Client/app/shared/constants/request.ts 137 bytes {1} [built]
[382] ./~/@angular/platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js 6.09 kB {1} [built]
[383] ./Client/app/browser-app.module.ts 2.83 kB {1} [built]
[384] ./Client/polyfills/browser.polyfills.ts 128 bytes {1} [built]
[399] ./Client/main.browser.ts 1.02 kB {1} [built]
[402] ./Client/polyfills/polyfills.ts 1.16 kB {1} [built]
[595] ./~/reflect-metadata/Reflect.js 48 kB {1} [built]
+ 640 hidden modules

ERROR in ./~/css-loader!./~/sass-loader/lib/loader.js!./Client/app/app.component.scss
Module build failed: Error: Missing binding C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\node-sass\vendor\win32-x64-51\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 7.x

Found bindings for the following environments:
  - Windows 64-bit with Node.js 5.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
    at module.exports (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\node-sass\lib\binding.js:15:13)
    at Object.<anonymous> (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\sass-loader\lib\loader.js:3:14)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at loadLoader (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\loader-runner\lib\loadLoader.js:13:17)
    at iteratePitchingLoaders (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
    at iteratePitchingLoaders (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
    at C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\loader-runner\lib\LoaderRunner.js:173:18
    at loadLoader (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\loader-runner\lib\loadLoader.js:36:3)
    at iteratePitchingLoaders (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
    at runLoaders (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\loader-runner\lib\LoaderRunner.js:362:2)
    at NormalModule.doBuild (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\webpack\lib\NormalModule.js:179:3)
    at NormalModule.build (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\webpack\lib\NormalModule.js:268:15)
    at Compilation.buildModule (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\webpack\lib\Compilation.js:146:10)
    at factoryCallback (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\webpack\lib\Compilation.js:329:11)
    at factory (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\webpack\lib\NormalModuleFactory.js:253:5)
    at applyPluginsAsyncWaterfall (C:\Users\Jürgen\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\node_modules\webpack\lib\NormalModuleFactory.js:99:14)
 @ ./Client/app/app.component.scss 2:21-138
 @ ./Client/app/app.component.ts
 @ ./Client/app/browser-app.module.ts
 @ ./Client/main.browser.ts

Child
Hash: 2666bfe356e8649d4d46
Time: 27462ms
Asset Size Chunks   Chunk Names
0.js 5.37 kB 0[

....

@j-nord Did you run npm rebuild node-sass --force? It appears you have multiple Nodes installed and you must have at least 6+, so you need to rebuild it. This is a strange workflow issue with node-sass itself :(

Got it working on my machine. Had to run npm install and npm rebuild from the windows command line rather than within visual studio 2017 as the visual studio version kept generating random errors and had trouble downloading packages from the internet. Also had to install and run webpack. Once these tasks were complete the server app began properly responding to http requests and serving web pages.

It's because VS comes with its own (very old) version of node. There is a way to change it to always use your $(PATH) version though.

Thanks Mark "npm rebuild node-sass " helps.

@j-nord excellent!

Hoping VS fixes some these underlying issues like the self installed (old versions of Node), and that node-sass finds a way to rebuild itself when it's not sure which version is running as well.

When in doubt, always just use your terminal, not a terminal inside VS !

Can we close this one out now?
If there are any other specific issues for you guys, just open up a new issue so we can figure it out? 🎈

@DotNetDev1 Don't worry, the repo will get easier in time 👍

Than you @MarkPieszak !

Was this page helpful?
0 / 5 - 0 ratings