bettercap/bettercap · error

Expected "${str}".

Error message

Expected "${str}".

What it means

Angular's UrlParser parses a serialized URL string token by token; this is the generic expectation helper that throws when the next characters of the remaining string do not match the syntactic element the parser needs (a delimiter like '/', '(', ')', ':' or a segment) — i.e. the URL string is malformed for the router grammar.

Source

Thrown at modules/ui/ui/vendor.js:76062

            var children = this.parseChildren();
            segments[outletName] = Object.keys(children).length === 1 ? children[PRIMARY_OUTLET] :
                new UrlSegmentGroup([], children);
            this.consumeOptional('//');
        }
        return segments;
    };
    UrlParser.prototype.peekStartsWith = function (str) { return this.remaining.startsWith(str); };
    // Consumes the prefix when it is present and returns whether it has been consumed
    UrlParser.prototype.consumeOptional = function (str) {
        if (this.peekStartsWith(str)) {
            this.remaining = this.remaining.substring(str.length);
            return true;
        }
        return false;
    };
    UrlParser.prototype.capture = function (str) {
        if (!this.consumeOptional(str)) {
            throw new Error("Expected \"" + str + "\".");
        }
    };
    return UrlParser;
}());

/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
var Tree = /** @class */ (function () {
    function Tree(root) {
        this._root = root;
    }
    Object.defineProperty(Tree.prototype, "root", {
        get: function () { return this._root.value; },

View on GitHub (pinned to 8eca2820f3)

Solutions

  1. Fix the malformed routerLink or URL string that fails to parse
  2. Check for unbalanced parentheses in auxiliary outlet syntax and missing outlet names
  3. Avoid manually constructing URLs with characters reserved by the router grammar; use router.serializeUrl
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/ui/ui/vendor.js:76062 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bettercap/bettercap@8eca2820f3 (2026-09-02). Data as JSON: /api/errors/81fbb4a3d23c37ff. Report an issue: GitHub.