Closed Tre665 closed 3 years ago
Ok, I tried some more and found the issue on my side. Somehow there was still an old package in that lead to the issue
"@nrwl/schematics": "^8.12.0",
Found it out when I wanted to move our solution to a new workspace.
I am very sorry if the creation of that issue has lead to confusion/inconveniences for you :(
I am not sure if that is the regular way how it should be done, but I would close that issue now.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
We migrated our workspace last week from NRWL/NX version 10 to the latest Version 11.3.1 All migration scripts could run and the process finished successfully (as a sidenote: big thumbsup to the new documention pages for the migration process 👍 )
I took the recommend migration path from the docs so migratet first to the latest 10.x version and after that to the latest version.
After it was merged in our main branch we discovered some issue when we wanted to add a new angular library to the project. It shows the following error on the console:
After lots of testing what could be wrong I recognised that if I change the Unit Test Task Runner to a different value then jest (Karma, none) it starts to work again. Unfortunately we are using jest so this is not an option for us.
I looked a little bit deeper into this issue and found the following code path which throws the error above in the file
invoke-nx-generator.js
in functioninvokeNxGenerator
at around line 48:Here is a check for
context.engine.workflow
and when it succeed it tries to read from thepaths
array fromengineHost
. In our case the wholepaths
property is missing somehow so it errors on that access.To solve this issue I could workaround it, if I explicitly check for the
paths
prop that is missing in our case:I also logged the the generator which calls this function and it is indeed the
jestProjectGenerator
. So maybe the root issue could potentially also be there.Sidenote: I later saw the pinned issue from Victor Savkin and tried the migration as it's described there. But the outcome was unfortunately the same.
What i also could observe is that removing tslib from the dependencies made also the generator to run again. But this is most likely a side effect of the missing lib which leads to other unwanted behavior of course :D
On a freshly new created and empty workspace the generator works as expected. So it might be an issue as well on a implicit dependencies that we use. But i tried to remove / adjust the versions as much as I could but hadn't any luck.
Expected Behavior
That the generators work as before in Version 10
Seems so, it worked until the latest version 10.
Steps to Reproduce
Unfortunately I think it's hard to reproduce the issue. At least I have currently no idea how I could replicate it since it might be a dependency / implicit dependency issue that triggers that behaviour. But if you need more informations I will do my best to add informations if they are helpfull.
Failure Logs
Environment
Old version (where it workded)
Updated Version (where it breaks):
our package.json deps:
As closing notes I want to thank all contributors for their hard work! It tremendously improved our way to work. And that you support such a vast amount of different technologies and environments with such little trouble for us consumers seems to be some kind of magic from the outside :D