Skip to content

ng test fails when using ngrx and module.Id #5143

Closed

Description

@alvipeo

OS?

Win 10 x64

Versions.

RC.0

Repro steps.

use moduleId in @component() decorator in a project where @NxRx is used. Run 'ng test' -> get weird errors.

The log given by the failure.

Module build failed: TypeError: Cannot read property 'getChildAt' of undefined
at refactor.findAstNodes.filter.forEach (E:\Documents\Visual Studio 2015\Projects\prj\node_modules@ngtools\webpack\src\loader.js:221:54)
at Array.forEach (native)
at _removeModuleId (E:\Documents\Visual Studio 2015\Projects\prj\node_modules@ngtools\webpack\src\loader.js:215:10)
at Promise.resolve.then.then (E:\Documents\Visual Studio 2015\Projects\prj\node_modules@ngtools\webpack\src\loader.js:298:33)

Activity

  1. hansl commented on Mar 1, 2017

    @hansl
    Contributor

    Hi @alvipeo, I tried reproducing this but couldn't. Could you give me a repository or some code example? What does your Component looks like?

  2. added
    needs: repro stepsWe cannot reproduce the issue with the information given
    on Mar 1, 2017
  3. alvipeo commented on Mar 1, 2017

    @alvipeo
    Author

    @hansl thanks for looking into this. Can I give you the link to the private repo? I have it in VSTS. I will need your MS account. Or I can zip it and give a private link (via email). Sorry, can't make that repo public.

  4. yusijs commented on Mar 6, 2017

    @yusijs

    I'm getting the same error, without ngrx in my project (although with angular-material):

    ERROR in ./src/app/home/home.component.ts
    Module build failed: TypeError: Cannot read property 'getChildAt' of undefined

    and

    ERROR in ./src/app/help/help.component.ts
    Module build failed: TypeError: Cannot read property 'getChildAt' of undefined

    I'm also getting this:

    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/karma_webpack/src/polyfills.ts' }

    Not certain if it's a related issue, but same module build error at least (I'm on rc.1)

    Wrote up a quick repo that reproduces the error for me.

    ng -v:

    @angular/cli: 1.0.0-rc.1
    node: 6.10.0
    os: linux x64
    @angular/common: 2.4.9
    @angular/compiler: 2.4.9
    @angular/core: 2.4.9
    @angular/forms: 2.4.9
    @angular/http: 2.4.9
    @angular/material: 2.0.0-beta.2
    @angular/platform-browser: 2.4.9
    @angular/platform-browser-dynamic: 2.4.9
    @angular/router: 3.4.9
    @angular/cli: 1.0.0-rc.1
    @angular/compiler-cli: 2.4.9

    Hope this helps :) (// cc @hansl)

  5. added 3 commits that reference this issue on Mar 19, 2017
    1d3b7f6
    572225b
    3d322cf
  6. added a commit that references this issue on Mar 20, 2017
    ebb495d
  7. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Sep 6, 2019
  9. added a commit that references this issue on May 29, 2026
    062e0c6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: more infoReporter must clarify the issueneeds: repro stepsWe cannot reproduce the issue with the information given

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions