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

Including moduleId property in @Component decorator causes 'Module build failed: TypeError: Cannot read property 'getChildAt' of undefined' #10

Closed
sebastienratez opened this issue Feb 22, 2017 · 0 comments

Comments

@sebastienratez
Copy link

sebastienratez commented Feb 22, 2017

Hi,

I have the same issue as posted in the angular-cli project: angular/angular-cli#4817 but I realized it may in fact be related to your project since I/we use your @component overwrite:

import { Component } from '@wwwalkerrun/nativescript-ngx-magic';

The problem happened after an update of angular libraries I think. moduleId is required to resolve paths for nativescript views etc. but not by the regular angular web engine. But it didn't use to bother it. Now this simple component crashes with the error explained in the github issue above.

import { Component } from '@wwwalkerrun/nativescript-ngx-magic';
import { OnInit } from '@angular/core';
import { Hero } from './model/Hero';
import { HeroesService } from './services/heroes.service';
@Component({
  moduleId: module.id,
  selector: 'app-root',
  templateUrl: './views/app/app.component.html',
  styleUrls: ['./views/app/app.component.css'],
  providers: [HeroesService]
})
export class AppComponent implements OnInit {
  title = 'app works!';
  heroes: Hero[] = [];
  
  constructor(private heroesService: HeroesService) {}
  
  ngOnInit(): void {
      this.heroesService.getHeroes().subscribe(heroesResult => this.heroes = heroesResult);
  }
}
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

1 participant