ng tests fails with Object prototype may only be an Object or null: undefined
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 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.