Skip to content
New issue

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

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

Already on GitHub? # to your account

TypeError: arg.trim is not a function #866

Closed
Ndpnt opened this issue Nov 30, 2022 · 2 comments
Closed

TypeError: arg.trim is not a function #866

Ndpnt opened this issue Nov 30, 2022 · 2 comments

Comments

@Ndpnt
Copy link

Ndpnt commented Nov 30, 2022

Hi,

Since the version 3.15.0 we get the following error:

Error: TypeError: arg.trim is not a function
    at GitExecutorChain.onFatalException (file:///Users/ndpnt/.nvm/versions/node/v16.15.1/lib/node_modules/@opentermsarchive/engine/node_modules/simple-git/dist/esm/index.js:1220:79)
    at GitExecutorChain.<anonymous> (file:///Users/ndpnt/.nvm/versions/node/v16.15.1/lib/node_modules/@opentermsarchive/engine/node_modules/simple-git/dist/esm/index.js:1212:24)
    at Generator.throw (<anonymous>)
    at rejected (file:///Users/ndpnt/.nvm/versions/node/v16.15.1/lib/node_modules/@opentermsarchive/engine/node_modules/simple-git/dist/esm/index.js:57:29)

Here is our initialization code:

    
    this.git = simpleGit(this.path, { maxConcurrentProcesses: 1 });

    await this.git.init();

    return this.git
      .addConfig('core.autocrlf', false)
      .addConfig('push.default', 'current')
      .addConfig('user.name', this.author.name)
      .addConfig('user.email', this.author.email);

We can fix the issue by adding { unsafe: { allowUnsafeProtocolOverride: true } }:

    
    this.git = simpleGit(this.path, { maxConcurrentProcesses: 1, unsafe: { allowUnsafeProtocolOverride: true } });

    await this.git.init();

    return this.git
      .addConfig('core.autocrlf', false)
      .addConfig('push.default', 'current')
      .addConfig('user.name', this.author.name)
      .addConfig('user.email', this.author.email);

But I wondered if this was the right way to fix the issue?

Note: Thus, unless I am mistaken, the minor release 3.15.0 seems to add a breaking change.

@steveukx
Copy link
Owner

Hello, thanks for the detailed stack trace.

I've created a patch 3.15.1 which is available on npm now that should resolve this error. Please let me know if you continue to see the error.

@Ndpnt
Copy link
Author

Ndpnt commented Nov 30, 2022

Everything is working fine now. Thank you very much for your responsiveness!

martinratinaud added a commit to OpenTermsArchive/engine that referenced this issue Feb 6, 2023
To prevent install of not working version when importing

steveukx/git-js#866
martinratinaud added a commit to OpenTermsArchive/engine that referenced this issue Feb 6, 2023
To prevent install of not working version when importing

steveukx/git-js#866
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants