Skip to content

GitPackIndex cannot read 'slice' of null #1163

@johnwiseheart

Description

@johnwiseheart

Using node:

const fs = require("fs")
const git = require("isomorphic-git")

git.log({ fs, dir: "/my-project", depth: 1, ref: "<sha>" }).then(res => console.log(res))

errors with:

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'slice' of null
    at GitPackIndex.readSlice (/my-project/node_modules/isomorphic-git/index.cjs:2666:35)

This appears to be coming from: https://github.com/isomorphic-git/isomorphic-git/blob/main/src/models/GitPackIndex.js#L297

I was not on the latest, but I tried upgrading and it's still happening.

What is strange is that its pretty intermittent - its only happening in my ci, and I can't seem to repro locally. Any idea what might be causing this? Perhaps some issue with the git repo? I tried a git fsck already but it didn't show up any issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions