Skip to content

Relative Paths in NextJS 15.2.2 #45

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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