Skip to content

Not working properly with Next.js Route Group #186

@MorookaKotaro

Description

@MorookaKotaro

Description

When configuring the following directory structure in the app router, the object keys in $path.ts conflict. (An object literal cannot have multiple properties with the same name.)

└── app/
    ├── (withHeader)/
    │   ├── layout.tsx
    │   └── items/
    │       └── page.tsx
    └── items/
        └── [itemId]/
            └── page.tsx

Environment

  • Package version: v0.22.0
  • OS:
    • Linux
    • Windows
    • macOS
  • Node.js version: v20.8.0
  • npm version: v10.1.0

Additional context

output

  "items": {
    $url: (url?: { hash?: string }) => ({ pathname: '/items' as const, hash: url?.hash, path: `/items${buildSuffix(url)}` })
  },
  "items": {
    _itemId: (itemId: string | number) => ({
      $url: (url?: { hash?: string }) => ({ pathname: '/items/[itemId]' as const, query: { itemId }, hash: url?.hash, path: `/items/${itemId}${buildSuffix(url)}` })
    })
  },

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