Skip to content

Workflows not bundled on page router #143

@erzr

Description

@erzr

I tried workflow on a Next.js Page Router project and ran into a couple of issues:

  1. It isn't clear the missing app directory error is coming from withWorkflow: https://github.com/vercel/workflow/blob/main/packages/cli/src/lib/builders/next-build.ts#L459-L461
  2. Workflows that might be referenced from API routes are not bundled (as observed in app/.well-known/workflow/v1/flow/route.js) unless the file name matches a pattern that app router uses: https://github.com/vercel/workflow/blob/main/packages/cli/src/lib/builders/next-build.ts#L324. Renaming the API route to route.ts resolves this issue.

Including the missing error incase it helps someone searching as well:

ReferenceError: Workflow "workflow//workflows/hmm.ts//handleUserSignup" must be a function, but got "undefined" instead

Metadata

Metadata

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