Repository navigation
Closed
Labels
Description
I am trying to use lerna for the Edge Platform. Right now I am in the phase of importing some old projects. Unfortunately, I have reproducible import issues which always seem to stop at specific commits. I am unaware of any specifics of these commits. The error message from Lerna is also not very helpful.
Expected Behavior
Importing should work on all packages.
Current Behavior
Currently Lerna throws during import with hard errors:
lerna info 1ebef2c
lerna info b1075d6
lerna info 3c0a15e
lerna ERR! execute callback with error
(node:58112) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot read property 'split' of undefined
(node:58112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Possible Solution
Check where the "split" call happens and why there is a possible null value inside the code.
Steps to Reproduce (for bugs)
All the code is open source so it should be possible for others to reproduce:
- New Multi Package Repository: https://github.com/sebastian-software/edge
- Packages which fail:
This happens also when using a freshly checked-out repository. So it is probably nothing about local changes.
Vers
lerna.json
{
"lerna": "2.4.0",
"packages": [
"packages/*"
],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
}lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->Context
Starting to use lerna.
Your Environment
| Executable | Version |
|---|---|
lerna --version |
2.4.0 |
npm --version |
5.5.1 |
yarn --version |
1.1.0 |
node --version |
8.6.0 |
git --version |
2.14.2 |
| OS | Version |
|---|---|
| macOS Sierra | 10.12.6 |
Reacted by azu and Tamlyn Rhodes
Activity
[-]"import" throws via various projects[/-][+]"import" throws with various projects[/+]swernerx commentedon Oct 8, 2017
I figure this is just a broken error handling as the
giterror which happens is not passed to the console log. Even when usingdebuglogging.I added the
elseblock above to log the error... but I figure the uncaught exception should still be dealt with. This is the new output after adding theelseblock:swernerx commentedon Oct 8, 2017
As suggested by the output adding
--flattenworks around this issue. But there seems to be another edge case related to empty patches.Output:
swernerx commentedon Oct 8, 2017
The remaining error is the result of Lerna to not cleanly handle empty commits. These should not be in Git repositories in the first place, but still, it might make sense to handle them in some variant so that it does not throw for users importing old repositories. The following variant (inside
ImportCommand.js:execute()) works well for me acting on thegiterror message (inside the babel transpiled code):swernerx commentedon Oct 8, 2017
Added a PR to fix the detected issues in the original source code:
#1059
thecodejack commentedon Oct 16, 2017
Facing same issue. Any ETA when this gets fixed? For me --flatten also failing. It randomly fails at different commits.
azu commentedon Oct 24, 2017
I've met same issue.
lerna importthrow following error when import https://github.com/textlint/gulp-textlint.lerna: 2.2.0 (2.4.0 also throw error)
Edit(2017-10-24):
I've used
--flattenand success imports.evocateur commentedon Oct 27, 2017
Thanks for your patience, I'm looking at the PR now.
webernir commentedon Oct 29, 2017
Thank you @azu @swernerx
using
--flattenworked for me as well.vzaidman commentedon Dec 5, 2017
--flattenworks indeed but as someone who uses "git flow" we NEED our merging history to not be ignored for all the packages we import.#615 solves it much more nicely.
vzaidman commentedon Dec 5, 2017
i end up using "git subtree" as follows:
stale commentedon Dec 27, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
lock commentedon Apr 3, 2019
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.