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

Invalid string length #5056

Closed
MinL-DN opened this issue Jul 19, 2022 · 9 comments · Fixed by #7563
Closed

Invalid string length #5056

MinL-DN opened this issue Jul 19, 2022 · 9 comments · Fixed by #7563
Assignees

Comments

@MinL-DN
Copy link

MinL-DN commented Jul 19, 2022

image

when I run pnpm i second time, this error show

when I run rm -rf /XXX/pnpm/store/v3 can fix it

pnpm version:

7.5.2

Code to reproduce the issue:

Expected behavior:

Additional information:

node -v
v16.14.0

macOS, Linux

@zkochan
Copy link
Member

zkochan commented Jul 20, 2022

Print also the value of depPath

@MinL-DN
Copy link
Author

MinL-DN commented Jul 20, 2022

image

this path ?

'/Users/minl/.nvm/versions/node/v16.14.0/lib/node_modules/pnpm/dist/pnpm.cjs'

@synapdk
Copy link

synapdk commented Oct 3, 2022

I experienced this on macOS 12.6 with pnpm 7.13.0 and node 16.16.0.

@lvndry
Copy link

lvndry commented Mar 27, 2023

Seems like running

pnpm clean
pnpm store prune
pnpm prune
pnpm i

Solved the problem for me

@vjpr
Copy link
Contributor

vjpr commented Jul 27, 2023

Upgrade from v7 to v8, same issue.


Patching with this technique seems to fix it:

https://stackoverflow.com/a/69548872/130910

Nope.

@jakebailey
Copy link
Member

I hit this in DefinitelyTyped/DefinitelyTyped#67455; thankfully I can "work around" this, but it does seem like there's a huge string allocated. I do wonder if this could just be an object hash instead of a serialized string. (That or it's #7079 which is the same?)

@zkochan
Copy link
Member

zkochan commented Jan 23, 2024

I do wonder if this could just be an object hash instead of a serialized string.

Yes, we can change it to an object hash. We need it for storing side-effects cache of dependencies (TBH, maybe we could store it simply by the dependency name but I am afraid that packages with differing dependencies may by built differently).

However, it would be nice to be able to reproduce it.

As a temporary fix, I think you can just disable side effects cache by setting side-effects-cache to false.

@jakebailey
Copy link
Member

However, it would be nice to be able to reproduce it.

If you're solely trying to verify it by hand, this happens on DefinitelyTyped for any change which modifies node's types; modifying a random file in types/node on DT and then running this should show the problem:

$ pnpm ls --depth Infinity --parseable --filter '...@types/**[HEAD^1]...'

(Or revert DefinitelyTyped/DefinitelyTyped#67460)

@jakebailey
Copy link
Member

My instructions were incomplete; I'll test the PR for you, though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants