Skip to content

Workflow does not work well/properly when using basePath on Nextjs app #1864

Closed

Description

@bhuone-garbu

I have multiple apps running side by side, and migrating 1 app but incrementally.

App 1 (the first nextjsapp)

  • Has all the routes

App 2 (has a base path /v2)

  • has workflow apis and routes under the workflows
  • App1 rewrites /v2 -> App2 everything works within nextjs

This is on Vercel logs.

Failed to handle /v2/.well-known/workflow/v1/flow Error: Cannot find module './.next/server/pages/clients/.well-known/workflow/v1/flow.js'
Require stack:
- /var/task/web/app_2/___next_launcher.cjs
- /opt/rust/nodejs.js
    at <unknown> (../../../../opt/rust/nodejs.js:2:13531)
    at Module.hn (../../../../opt/rust/nodejs.js:2:13909)
    at Xe.e.<computed>.Ye._load (../../../../opt/rust/nodejs.js:2:13501) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/var/task/web/app_2/___next_launcher.cjs',
    '/opt/rust/nodejs.js'
  ]
}

The app side by side is just a thing that exists. But even if I run app2 on it's own locally, I still get:

POST /.well-known/workflow/v1/flow 404 in 99ms (next.js: 17ms, application-code: 82ms)

Activity

  1. VaguelySerious commented on Nov 2, 2026

    @VaguelySerious
    Member

    (AI) If anyone still hits Cannot find module './.next/server/pages/<basePath>/.well-known/workflow/v1/flow.js' with a Next.js basePath on Vercel: #2732 fixed the SDK side, but the same error still happens when Vercel builds the app with the Next.js build adapter. Details and root cause are in #4971.

    Workaround: set the project environment variable NEXT_ENABLE_ADAPTER=0 and redeploy without the build cache. In my reproduction, runs complete afterwards with basePath still set. It's not a documented setting, so treat it as temporary until the adapter fix ships.

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