Regression: project is not working anymore from 6.0.8 -> 6.1.0 (in lerna monorepos)
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x)
- [x] all
Repro steps
Our angular/cli project ist located as one package of a larger lerna monorepo. We also make use of yarn workspaces, so all (or most) dependencies are hoisted within one single root node_modules folder. The resulting structure is something like
- node_modules <-- angular dependencies installed here
- @angular
- cli
- core
- ...
- packages
- angular-app
- package.json <-- angular dependencies defined here
- src
- ....
- package.json <-- no angular dependencies defined here
this line now (as of 6.1.0) prevents the project from working (at all) because relativePotential.startsWith('..') === true because in our structure relativePotential = ../../node_modules/@angular/core/package.json
everything was working fine with 6.0.8
The log given by the failure
You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
Desired functionality
I can work on my angular project with latest versions of everything
Same setup - same issue here. Working on a workaround, I'll let you know if it works.
I have been playing around with combining lerna packages with angular worspace, so I would pull the angular.json and all related dependencies into the root package. Then the lerna packages would be semantically the same as the angular workspace libraries/applications. This would also "fix" this bug, as the angular project root would be equal to the lerna root. I am confident this will work (and will be cool)
However this is not something we can easily achieve in existing projects and I still see this as regression bug.
Same here. We have tried both Lerna and Rush.js, same result.
@hansl I am happy to create a PR for this issue. However, this is not really a bug in the code, more like a decision on how you check for dependencies. Is there anything I can do to speed this up?
maybe there is the need for a setting in angular.json to make clear what is considered to "be within the project"
See this issue with linked PRs https://github.com/angular/angular-cli/issues/3864
still broken in 6.1.2
6.1.3 🤷♂️
Added to the top of our backlog
In the meantime, not ideal, but a quick fix on the lerna.json file to NOT hoist certain dependencies..
"bootstrap": {
"nohoist": [
"@angular/*",
"@angular-devkit/build-angular",
"rxjs",
"@ngtools/*"
]
}
Actually, even this fix above is a nightmare as anything that is used by the UI needs to be set as a NOHOIST ...... So its a lot of packages. Anybody find an alternative fix ?
I am using 6.1.5 (installed today).
@appsolutegeek try to add your dependencies in the root package.json. Then you will be able to hoist the dependencies within your packages.
I'm having the same issue, with only using Yarn workspaces. The nohoist option in package.json is indeed a fair temporary fix (thanks @appsolutegeek!) - hopefully this' will be fixed in the future.
@gombosg no problem, hopefully, we can update the cli soon, so I can remove the NO HOIST packages.
sadly, the nohoist option is only available for private packages
also sadly
Added to the top of our backlog
does not seem to mean "this is the very next issue that gets fixed"
6.2.0, 7.0.0 😔
Is there any update when the issue will be fixed?
@hansl 👍
wait a minute, why did this not land in 6.2.4 ???