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

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

Closed
alvipeo opened this issue Mar 1, 2017 · 4 comments · Fixed by #5510
Closed

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

alvipeo opened this issue Mar 1, 2017 · 4 comments · Fixed by #5510
Labels
needs: more info Reporter must clarify the issue needs: repro steps We cannot reproduce the issue with the information given

Comments

@alvipeo
Copy link

alvipeo commented Mar 1, 2017

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)

@hansl
Copy link
Contributor

hansl commented Mar 1, 2017

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?

@hansl hansl added needs: more info Reporter must clarify the issue needs: repro steps We cannot reproduce the issue with the information given labels Mar 1, 2017
@alvipeo
Copy link
Author

alvipeo commented Mar 1, 2017

@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.

@yusijs
Copy link

yusijs commented Mar 6, 2017

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)

hansl added a commit to hansl/angular-cli that referenced this issue Mar 19, 2017
Technically that program should always be the valid one, and is needed in some cases (e.g. diagnostics).
Adding parent nodes get rid of the getChildAt error that happens, because the prop.parent is not
set.

The issue happened because people are using "files": ["main.ts"] or something similar, and when we load
another file than main we dont set the parent nodes.

Fixes angular#5143
Fixes angular#4817
hansl added a commit to hansl/angular-cli that referenced this issue Mar 19, 2017
Technically that program should always be the valid one, and is needed in some cases (e.g. diagnostics).
Adding parent nodes get rid of the getChildAt error that happens, because the prop.parent is not
set.

The issue happened because people are using "files": ["main.ts"] or something similar, and when we load
another file than main we dont set the parent nodes.

Fixes angular#5143
Fixes angular#4817
hansl added a commit to hansl/angular-cli that referenced this issue Mar 20, 2017
Technically that program should always be the valid one, and is needed in some cases (e.g. diagnostics).
Adding parent nodes get rid of the getChildAt error that happens, because the prop.parent is not
set.

The issue happened because people are using "files": ["main.ts"] or something similar, and when we load
another file than main we dont set the parent nodes.

Fixes angular#5143
Fixes angular#4817
hansl added a commit that referenced this issue Mar 20, 2017
Technically that program should always be the valid one, and is needed in some cases (e.g. diagnostics).
Adding parent nodes get rid of the getChildAt error that happens, because the prop.parent is not
set.

The issue happened because people are using "files": ["main.ts"] or something similar, and when we load
another file than main we dont set the parent nodes.

Fixes #5143
Fixes #4817
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue needs: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants