Skip to content

Nested unnamed include() never matches: its routes answer 404 with no warning #1104

Closed

Description

@ivogt

What happens

On 0.22.1, the routes of an unnamed include() that sits inside another unnamed include() are never matched. They answer 404, with no warning at build or rango generate time.

// urls.tsx
include("/", publicPatterns), // unnamed

// urls-public.tsx
export const publicPatterns = urls(({ include }) => [
  include("/", signInPatterns), // unnamed, nested: /login now answers 404
]);

Giving the inner include a name, even an empty one, fixes it: include("/", signInPatterns, { name: "" }).

Expected

Nested unnamed includes match the same as one level does. If they can't, the generator or the router fails loudly and names the include.

Why it matters

The typecheck, unit tests and rango generate all passed. Only an end-to-end test that signed in caught it, after every public route of the app had gone 404.

To recheck before work starts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions