Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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:
    9
    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:
    756
    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:
    9
    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.