Skip to content

Workflow execution fails with Turbopack: TP1006 path.join is very dynamic #35

@camwest

Description

@camwest

Issue

Workflows fail to execute when using Next.js with Turbopack (default in Next.js 16).

Error

Error: [turbopack-node]/transforms/transforms.ts:53:10
lint TP1006 path.join(???*0*, (???*2* ? ???*5* : ???*7*)) is very dynamic

  51 | }
  52 | export const fromPath = (path: string) => {
> 53 |   return join(contextDir, sep \!== '/' ? path.replaceAll('/', sep) : path)
     |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  54 | }

Import trace:
  webpack_loaders:
    [turbopack-node]/transforms/transforms.ts
    [turbopack-node]/transforms/webpack-loaders.ts

Reproduce

# Next.js 15 project with Turbopack
yarn add workflow@4.0.1-beta.2

# next.config.mjs
import { withWorkflow } from "workflow/next";
export default withWorkflow(nextConfig);

# Create basic workflow with "use workflow" directive
yarn dev --turbopack
curl http://localhost:3000/api/test-workflow

Expected

Workflow executes successfully.

Actual

  • ✅ Dev server starts
  • ✅ Workflow directives discovered
  • ❌ Workflow execution returns 500 error

Environment

  • workflow@4.0.1-beta.2
  • Next.js 15.5.6 with --turbopack
  • Node v22.19.0
  • Yarn 4.9.4

Workaround

Remove --turbopack flag (use webpack instead).

Impact

Critical for Next.js 16 adoption: Next.js 16 uses Turbopack by default, which will break all workflow applications on upgrade unless this is fixed or Next.js provides an opt-out mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions