Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5.4 breaking change detection of subscriptions on startup #8

Closed
denodaeus opened this issue May 5, 2016 · 4 comments
Closed

0.5.4 breaking change detection of subscriptions on startup #8

denodaeus opened this issue May 5, 2016 · 4 comments

Comments

@denodaeus
Copy link

denodaeus commented May 5, 2016

modules.js:60044 TypeError: Cannot read property 'lastRootNode' of undefined
    at AppElement.attachView (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:55190:37)
    at ViewContainerRef_.insert (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:55392:23)
    at ViewContainerRef_.createEmbeddedView (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:55372:14)
    at NgFor._bulkInsert (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:76912:41)
    at NgFor._applyChanges (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:76865:14)
    at NgFor.ngDoCheck (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:76847:22)
    at AppView._View_ProjectMenuProjectSelectorComponent0.detectChangesInternal (ProjectMenuProjectSelectorComponent.template.js:107:42)
    at AppView.detectChanges (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:56194:22)
    at AppView.detectViewChildrenChanges (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:56223:34)
    at AppView.detectChangesInternal (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:56214:14)BrowserDomAdapter.logError @ modules.js:60044
modules.js:60044 ERROR CONTEXT:BrowserDomAdapter.logError @ modules.js:60044
modules.js:60044 DebugContextBrowserDomAdapter.logError @ modules.js:60044
modules.js:85656 Uncaught EXCEPTION: Error in ./ProjectMenuProjectSelectorComponent class ProjectMenuProjectSelectorComponent - inline template:12:38
ORIGINAL EXCEPTION: TypeError: Cannot read property 'lastRootNode' of undefined
ORIGINAL STACKTRACE:
TypeError: Cannot read property 'lastRootNode' of undefined
    at AppElement.attachView (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:55190:37)
    at ViewContainerRef_.insert (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:55392:23)
    at ViewContainerRef_.createEmbeddedView (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:55372:14)
    at NgFor._bulkInsert (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:76912:41)
    at NgFor._applyChanges (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:76865:14)
    at NgFor.ngDoCheck (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:76847:22)
    at AppView._View_ProjectMenuProjectSelectorComponent0.detectChangesInternal (ProjectMenuProjectSelectorComponent.template.js:107:42)
    at AppView.detectChanges (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:56194:22)
    at AppView.detectViewChildrenChanges (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:56223:34)
    at AppView.detectChangesInternal (http://localhost:3000/packages/modules.js?hash=0c9dd35cb39b5446f600a261723587f6a093b622:56214:14)
ERROR CONTEXT:
[object Object]

ProjectMenuProjectSelectorComponent is really simple:

@Component({
  selector: 'kui-project-menu-projects',
  // remove *simple* from below list to turn of html5 rendered menu
  template: `
    <div class="ui simple dropdown item" tabindex="0">
      <label>
        <span style="color: #9c9c9c;">
          Project: &nbsp;&nbsp;
        </span>
        <b>
          TODOS
        </b>
      </label>
      <i class="dropdown blue icon"></i>
      <div class="menu">
        <div class="item float right" *ngFor="let project of projects">
          {{ project.name }}
        </div>
      </div>
    </div>
  `
})
class ProjectMenuProjectSelectorComponent extends MeteorComponent {
  private projects: Mongo.Cursor<Project>;

  constructor() {
    super();

    this.projects = Projects.find();
    this.subscribe('projects');
  }
}

Downgrading to angular2-meteor-auto-bootstrap 0.5.2 fixes the problem.

package.json:

{
  "dependencies": {
    "angular2": "^2.0.0-beta.17",
    "angular2-meteor": "^0.5.4",
    "angular2-meteor-auto-bootstrap": "0.5.2",
    "dragula": "^3.6.8",
    "es6-shim": "^0.35.0",
    "lodash": "^4.11.2",
    "meteor-node-stubs": "^0.2.3",
    "ng2-dragula": "^1.1.6",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.6",
    "zone.js": "^0.6.12"
  },
  "devDependencies": {
    "codelyzer": "0.0.19",
    "rimraf": "^2.5.2",
    "spacejam": "^1.5.2",
    "tsconfig-lint": "^0.11.0",
    "typings": "^0.8.1"
  }
}
@marcalj
Copy link

marcalj commented Jun 6, 2016

I have the same issue with a normal Angular 2 component (not using meteor at all).
ngFor seems to add an extra item of array and cannot find elements :(

@dotansimha
Copy link
Collaborator

@denodaeus can you please provide an example for code/repository with this issue?

Thanks.

@barbatus
Copy link
Collaborator

obsolete

@ghost
Copy link

ghost commented Oct 8, 2016

Same issue encountered

modules.js?hash=13d9661…:88455 TypeError: Cannot read property 'lastRootNode' of undefined
    at AppElement.attachView (modules.js?hash=13d9661…:70382)
    at ViewContainerRef_.insert (modules.js?hash=13d9661…:70582)
    at ViewContainerRef_.createEmbeddedView (modules.js?hash=13d9661…:70562)
    at modules.js?hash=13d9661…:79287
    at MongoCursorDiffer.forEachOperation (modules.js?hash=13d9661…:138650)
    at NgFor._applyChanges (modules.js?hash=13d9661…:79285)
    at NgFor.ngDoCheck (modules.js?hash=13d9661…:79279)
    at DebugAppView._View_MovementList0.detectChangesInternal (MovementList.ngfactory.js:223)
    at DebugAppView.AppView.detectChanges (modules.js?hash=13d9661…:72006)
    at DebugAppView.detectChanges (modules.js?hash=13d9661…:72112)
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0",
    "angular2-infinite-scroll": "^0.2.3",
    "angular2-meteor": "^0.7.0-beta.1",
    "angular2-meteor-polyfills": "^0.1.1",
    "angular2-pagination": "^0.2.1",

Apparently happens on a redisplay of a collection after subsequent subscribe's #find().

Tying to isolate the issue.

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

No branches or pull requests

4 participants