Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Preboot with buffer true causes crash #4

Closed
9 tasks
jeffwhelpley opened this issue Jul 14, 2016 · 2 comments
Closed
9 tasks

Preboot with buffer true causes crash #4

jeffwhelpley opened this issue Jul 14, 2016 · 2 comments

Comments

@jeffwhelpley
Copy link
Contributor

Transferred over from angular/universal#458. Originally entered by @sittingbool

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 ...
  • [x ] 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
  • [x ] preboot
  • universal-preview
  • universal
  • webpack-prerender
  • Do you want to request a feature or report a bug?

Report a bug.

  • What is the current behavior?

I am using the current universal-starter project. I wanted to see if buffering helps avoid the page to be re-rendered on client. So I set this option to true.

  • 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.
  1. change preboot: false to preboot: { appRoot: 'app', buffer: true }
  2. restart server and relpad page
  3. see server console output, which shows:

TypeError: Cannot read property 'unsubscribe' of undefined
at Router.dispose (/Users/myUser/myProject/node_modules/@angular/router/router.js:117:71)
Rendering Document Error: [TypeError: Cannot read property 'unsubscribe' of undefined]
at /Users/myUser/myProject/node_modules/@angular/router/common_router_providers.js:16:56
at /Users/myUser/myProject/node_modules/@angular/core/src/application_ref.js:428:68
at Array.forEach (native)
at Object.Call (/Users/myUser/myProject/node_modules/angular2-universal/node_modules/angular2-universal-polyfills/node_modules/es6-shim/es6-shim.js:289:14)
at Array.forEach (/Users/myUser/myProject/node_modules/angular2-universal/node_modules/angular2-universal-polyfills/node_modules/es6-shim/es6-shim.js:1295:17)
at ApplicationRef_.dispose (/Users/myUser/myProject/node_modules/@angular/core/src/application_ref.js:428:32)
at /Users/myUser/myProject/node_modules/angular2-universal/dist/node/bootloader.js:156:45
at ZoneDelegate.invoke (/Users/myUser/myProject/node_modules/angular2-universal/node_modules/angular2-universal-polyfills/node_modules/zone.js/dist/zone-node.js:281:29)
at Zone.run (/Users/myUser/myProject/node_modules/angular2-universal/node_modules/angular2-universal-polyfills/node_modules/zone.js/dist/zone-node.js:174:44)

  • What is the expected behavior?

No error on server-side

  • What is the motivation / use case for changing the behavior?

I hope buffering so the page doesn't re-render on client.

  • Please tell us about your environment:
  • Angular version: 2.0.0-beta.2
  • Browser: [Chrome Version 51.0.2704.103 (64-bit) ]
  • Language: [TypeScript 1.8.10 ]
  • OS: [Mac OS X ]
  • 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)
@jeffwhelpley
Copy link
Contributor Author

@MarkPieszak response to this (transferred from universal repo): @sittingbool The starter has undergone some big changes in the past few days, can you give it a shot with the Latest one? Just pulled a fresh one down (angular rc3, universal 104.1, etc).

In the server.ts I changed: preboot: { appRoot: 'app', buffer: true }

It seemed to work fine, it might be that you're on a slightly older one? Let me know when you give it a try!

@jeffwhelpley
Copy link
Contributor Author

This appears to be fixed in the latest version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant