universal: "Cannot read property 'makeCurrent' of undefined" on ng serve clean CLI install

Note: for support questions, please use one of these channels: https://github.com/angular/universal/blob/master/CONTRIBUTING.md#question. This repository’s issues are reserved for feature requests and bug reports.

  • I’m submitting a …
  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.
  • What modules are related to this pull-request
  • express-engine
  • grunt-prerender
  • gulp-prerender
  • hapi-engine
  • preboot
  • universal-preview
  • universal
  • webpack-prerender
  • Do you want to request a feature or report a bug? Bug
  • What is the current behavior? After clean install ng new project --mobile ng serve results in this error (even after npm install)

Could not start watchman; falling back to NodeWatcher for file system events. Visit http://ember-cli.com/user-guide/#watchman for more info. Cannot read property 'makeCurrent' of undefined TypeError: Cannot read property 'makeCurrent' of undefined at Object.<anonymous> (/Users/andrew/Sites/hello-mobile/node_modules/angular2-universal/dist/node/node.js:7:35) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:20:19) at Object.<anonymous> (/Users/andrew/Sites/hello-mobile/node_modules/angular2-universal/dist/node/index.js:5:17) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17) at require (internal/module.js:20:19) at Object.<anonymous> (/Users/andrew/Sites/hello-mobile/node_modules/angular2-broccoli-prerender/dist/prerender.js:8:28) at Module._compile (module.js:413:34)

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem by creating a github repo. https://github.com/andrewparadi/hello-mobile
  • What is the expected behavior? ng serve completes
  • What is the motivation / use case for changing the behavior?
  • Please tell us about your environment:
  • Angular version: 2.0.0-beta.X
  • Browser: all
  • Language: TypeScript X.X
  • OS: Mac OS X 10.11.6 beta
  • Platform: NodeJS
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I managed to solve this problem updating the version of “angular2-broccoli-prerender” and “angular2-universal”, make sure you are using the version of angular-cli 1.0.0-beta.9 and type the following and will work:

ng new <PROJECT_NAME>
cd <PROJECT_NAME>
npm uninstall --save-dev angular2-broccoli-prerender
npm uninstall --save-dev angular2-universal
npm cache clear
npm install --save-dev angular2-broccoli-prerender
npm install --save-dev angular2-universal
npm install
npm start

or simply change the versions on package.json and run npm install…

"angular2-broccoli-prerender": "^0.11.5",
"angular2-universal": "^0.104.5"

@andrewparadi it’s likely enough that the next CLI beta will have changed the build process to use webpack, and with that also changed the way mobile apps are built. So in that sense the next beta release should fix all these issues I think.

I’m getting the same error from a clean install.

Apparently it is just failing when you use the --mobile flag when you try to create a new project.

TypeError: Cannot read property 'makeCurrent' of undefined

I just did this and now it’s working. Not sure if it make sense to create a PR with this fix. Can please someone validate if that would be the right solution?