When the jmespath parser handles a syntax error related to parsing slice expressions, it's throwing an error message:
Syntax error: unexpected token: undefined(undefined)
Which, it should actually have token and value instead of undefined.
In the Parser's _parseSliceExpression() function, it looks like this:
var t = this._lookahead(0);
var error = new Error("Syntax error, unexpected token: " +
t.value + "(" + t.type + ")");
Solution: it should use this._lookaheadToken() instead of this._lookahead(). The this._lookaheadToken() will return a token object that will actually contain .type and .value properties