Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm 4.9.3 stops silently in iterm2 with quite narrow width #2353

Closed
freewind opened this issue Feb 10, 2020 · 1 comment
Closed

pnpm 4.9.3 stops silently in iterm2 with quite narrow width #2353

freewind opened this issue Feb 10, 2020 · 1 comment
Assignees
Milestone

Comments

@freewind
Copy link

freewind commented Feb 10, 2020

pnpm version:

pnpm 4.9.3

Code to reproduce the issue:

open iterm2, adjust the width to be very narrow, e.g. less than 200px or smaller, then run pnpm:

/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/bin/pnpm.js -h

or any other commands other than -v

/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/bin/pnpm.js i

Expected behavior:

pnpm prints help or print output of that command

Actual behavior:

Outputs nothing and does nothing, stops silently.

Additional information:

  • node -v prints: v12.12.0
  • Windows, OS X, or Linux?: OS X

I actually found the problem. I edited .pnpm/4.9.3/lib/bin/pnpm.js, added a line to print the thrown errors in runPnpm:

async function runPnpm() {
    const errorHandler = (await Promise.resolve().then(() => require('../err'))).default;
    try {
        const main = (await Promise.resolve().then(() => require('../main'))).default;
        await main(argv);
    }
    catch (err) {
        console.log(err);  // !!!! added this line to print error to console
        errorHandler(err);
    }
}

And the error is:

$/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/bin/pnpm.js i
Error: Column width must be greater than 0.
    at calculateCellHeight (/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/lib/node_modules/table/dist/calculateCellHeight.js:30:11)
    at /Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/lib/node_modules/table/dist/calculateRowHeightIndex.js:39:66
    at Array.forEach (<anonymous>)
    at /Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/lib/node_modules/table/dist/calculateRowHeightIndex.js:30:11
    at Array.forEach (<anonymous>)
    at calculateRowHeightIndex (/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/lib/node_modules/table/dist/calculateRowHeightIndex.js:28:8)
    at Object.table (/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/lib/node_modules/table/dist/table.js:100:63)
    at renderDescriptionList (/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/lib/node_modules/render-help/lib/index.js:38:30)
    at renderHelp (/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/lib/node_modules/render-help/lib/index.js:68:49)
    at Object.help (/Users/peng.li/workspace/uc-frontend/.pnpm/4.9.3/lib/node_modules/@pnpm/plugin-commands-listing/lib/list.js:30:12)

Seems like the iterm2 window is too narrow that makes internal table calculation break, and the error is caught silently.

image

(my monitor resolution is 1680x1050)

@zkochan zkochan self-assigned this Feb 22, 2020
@zkochan zkochan added this to the v4.10 milestone Feb 22, 2020
zkochan added a commit to zkochan/packages that referenced this issue Feb 22, 2020
zkochan added a commit that referenced this issue Feb 22, 2020
@zkochan
Copy link
Member

zkochan commented Feb 24, 2020

fixed in 4.10.0-1

@zkochan zkochan closed this as completed Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants