angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng tests fails with Object prototype may only be an Object or null: undefined

Open neridonk opened this issue 9 years ago • 5 comments

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Repro steps.

I created a small project, after I was finished I thought, why not implementing tests, I really don't know why it failed, the error says nothing to me: ng test

I have to say I had a similar error when one global component had an absolute path definition

before import { UserService } from '../../../user/user.services'; after(working one) import { UserService } from 'services';

https://github.com/angular/angular-cli/issues/5769

The log given by the failure.

Uncaught TypeError: Object prototype may only be an Object or null: undefined at setPrototypeOf () at Array.concat.__extends (test.ts:65929) at test.ts:65939 at Object.Array.concat.Object.setPrototypeOf.proto (test.ts:65998) at webpack_require (test.ts:20) at Object.Array.concat.Object.defineProperty.value (test.ts:15750) at webpack_require (test.ts:20) at Object.Array.concat.Object.defineProperty.value (test.ts:64892) at webpack_require (test.ts:20) at Object.Array.concat.Object.defineProperty.value (test.ts:15645) at webpack_require (test.ts:20) at Object.Array.concat.c (test.ts:65154) at webpack_require (test.ts:20) at Object.Array.concat.Object.defineProperty.value (test.ts:15659) at webpack_require (test.ts:20)

Desired functionality.

working

Mention any other details that might be useful.

My tsconfig includes routes of shared elements

"paths": { "services": [ "app/global/services/index" ], "models": [ "app/models/index" ], "components": [ "app/global/components/index" ], "directives": [ "app/global/directives/index" ] },

neridonk avatar May 11 '17 13:05 neridonk

@neridonk Is there a repo where you can replicate the issue.

sumitarora avatar May 11 '17 14:05 sumitarora

Ok I resolved this it has to do with the paths, a lil bit sensitive but okey

neridonk avatar May 11 '17 14:05 neridonk

@neridonk What have you changed in paths?

pkoral avatar May 22 '17 11:05 pkoral

I think it isn't solution. I am going to use barrels in my projects, and it's very useful for me, but now I can't build my project with AOT, it's a great bug

SurenAvagyanG avatar Dec 27 '17 22:12 SurenAvagyanG

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.