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

Created on 11 May 2017  路  5Comments  路  Source: angular/angular-cli

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"
]
},

low more info

Most helpful comment

@neridonk What have you changed in paths?

All 5 comments

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

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

@neridonk What have you changed in paths?

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

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

Was this page helpful?
0 / 5 - 0 ratings