Hi I m getting a strang…

1 minute read

Hi, I’m getting a strange error message. I’ve created a new lib, I’m running its test using nx test myLib and I get the following error: TypeError: Cannot read property 'test' of undefined

Responses:

That’s the callstack: at getOutputsForTargetAndConfiguration (/Users/yonatan.kr/Code/insights/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:44:42) at Object.getOutputs (/Users/yonatan.kr/Code/insights/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:40:12) at TaskOrchestrator.forkProcess (/Users/yonatan.kr/Code/insights/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:120:37) at takeFromQueue (/Users/yonatan.kr/Code/insights/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:48:26) at TaskOrchestrator.<anonymous> (/Users/yonatan.kr/Code/insights/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:69:27) at Generator.next (<anonymous>) at /Users/yonatan.kr/Code/insights/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:8:71 at new Promise (<anonymous>) at __awaiter (/Users/yonatan.kr/Code/insights/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:4:12) at TaskOrchestrator.runRest (/Users/yonatan.kr/Code/insights/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:40:16)

Tests of other libs in the same project work just fine

Ok - this is strange - “build” fails for the same reason

It doesn’t matter what I do in this project - a lib with this name just isn’t working with any CLI command

The architect property does not exist

While debugging, I see that in the nodes list (inside the projectGraph the said library is set as type: "npm" and is missing quite a few things. I even tried installing a new lib with a different name, see that I can run test/build and then rename it (also changing any reference in the nx.json and workspace.json) - to no avail

Ok - I think I’ve found the issue

I have @myNameSpace/lib and also I have a dependency lib from npm - so the graph is being built for the libs correctly - but then when it starts building the dependncies npm graph, it overrides the local lib with the npm module (which does not have an architect property on its node)

Updated: