Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

ERR_STRING_TOO_LONG Cannot create a string longer than 0x3fffffe7 characters

Discussion in 'Package Manager' started by Gunvald, Oct 26, 2019.

  1. Gunvald

    Gunvald

    Joined:
    Oct 9, 2018
    Posts:
    5
    Hi folk,

    I got this error message while trying to publish a package larger than 1GB to our local NPM registry. Looks like a Nodejs issue but I hope the Unity community should have the experience with it. Guessing a lof of project will create as large packages with graphical assets.

    Thanks in advance!
     
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    601
    Hi @Gunvald ,

    You are right. This is a *NodeJS/npm* issue. As long as we rely on it to publish packages, we will have to cope with this limitation. NodeJS offers a configuration to increase the string buffer size limit. If you have Node 8.x or greater installed, you can try set the env var
    NODE_OPTIONS=--max_old_space_size=4096
    .

    I haven't tried this myself. So, if you can, let us know if it works!

    Regards,

    Pascal
     
  3. Gunvald

    Gunvald

    Joined:
    Oct 9, 2018
    Posts:
    5
    Hi Pascal,

    I have tried increasing the max_old_space_size, which is solution for another type of error indeed.
    FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory.

    So far, I have to split up the large package into smaller pieces as a workaround. Really hope the Unity editor built-in solution will work soon, with authentication.

    Thanks!
     
    okcompute_unity likes this.