Skip to content

Template: generatePreviewPath imports from wrong route group '(frontend)' instead of '(app)' #16361

@felipepalazzo

Description

@felipepalazzo

Describe the bug

After #14947, the ecommerce template fails pnpm build with a TypeScript error in src/utilities/generatePreviewPath.ts:

./src/utilities/generatePreviewPath.ts:1:37
Type error: Cannot find module '@/app/(frontend)/next/preview/route' or its corresponding type declarations.

The utility imports PreviewSearchParams from @/app/(frontend)/next/preview/route, but the route actually lives at src/app/(app)/next/preview/route.ts. The route group was renamed but the import wasn't updated.

To Reproduce

  1. Scaffold from the e-commerce template
  2. Run pnpm build.
  3. TypeScript check fails with the error above.

Expected behaviour

Template builds cleanly out of the box.

Suggested fix

In templates/ecommerce/src/utilities/generatePreviewPath.ts line 1, change:

import { PreviewSearchParams } from '@/app/(frontend)/next/preview/route'

to:

import { PreviewSearchParams } from '@/app/(app)/next/preview/route'

Environment

  • Payload: 3.84.0
  • Next.js: 16.2.3
  • Node: 20
  • Template: ecommerce

Metadata

Metadata

Assignees

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