Skip to content

Relative Paths in NextJS 15.2.2 #45

@CodeChooch4

Description

@CodeChooch4

When using with NextJS 15.2.2 the Link component from "next/link" is interpreting the path returned by Home({}) or any other route as relative versus absolute. A quick fix is to wrap the route with an ensureAbsolutePath function like below.

function ensureAbsolutePath(path: string): string { return path.startsWith("/") ? path :/${path}; }

I will dig into the makeRoute.ts asset for NextJS and submit a PR with a correction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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