Skip to content

Invalid check in router/url_tree/parseParens #58516

@abdes

Description

@abdes

Which @angular/* package(s) are the source of the bug?

router

Is this a regression?

No

Description

The parseParens method in url_tree.ts has a sanity check that checks if segment group is properly closed or not.

// if is is not one of these characters, then the segment was unescaped
// or the group was not closed
if (next !== '/' && next !== ')' && next !== ';') {
throw new RuntimeError(
RuntimeErrorCode.UNPARSABLE_URL,
(typeof ngDevMode === 'undefined' || ngDevMode) && `Cannot parse url '${this.url}'`,
);
}

This check does not pass when the segment group is defining an outlet with a path and children. For example:

/Home(app:Welcome//dock:left(1:One;pinned//2:Two;below=1//3:Three;pinned;above=2//4:Four))

In this case, after matching the outlet and its segments (dock:left), the next character is a ( to specify the children.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions