-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Description
After upgrading the workflow and @workflow/ai packages to 4.0.1-beta.39, I am unable to import WorkflowChatTransport in any client component. It looks like nextjs is trying to bundle @workflow/core into a client bundle.
This can be reproduced in vercel/workflow-examples by upgrading the package versions and running the pnpm dev on the flight booking app as I did here
The full error is below.
## Error Type
Build Error
## Error Message
Code generation for chunk item errored
## Build Output
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/runtime/world.js
Code generation for chunk item errored
An error occurred while generating the chunk item [project]/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/runtime/world.js [app-client] (ecmascript)
Caused by:
- the chunking context (unknown) does not support external modules (request: node:module)
Debug info:
- An error occurred while generating the chunk item [project]/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/runtime/world.js [app-client] (ecmascript)
- Execution of <ModuleChunkItem as EcmascriptChunkItem>::content_with_async_module_info failed
- Execution of *EcmascriptChunkItemContent::new failed
- Execution of EcmascriptModuleContent::new failed
- the chunking context (unknown) does not support external modules (request: node:module)
Import traces:
Client Component Browser:
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/runtime/world.js [Client Component Browser]
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/serialization.js [Client Component Browser]
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/step/writable-stream.js [Client Component Browser]
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/index.js [Client Component Browser]
./node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@aws-sdk+client_9829537cd50594c6b8f43bea9dee5ca1/node_modules/@workflow/ai/dist/agent/durable-agent.js [Client Component Browser]
./node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@aws-sdk+client_9829537cd50594c6b8f43bea9dee5ca1/node_modules/@workflow/ai/dist/index.js [Client Component Browser]
./app/page.tsx [Client Component Browser]
./app/page.tsx [Server Component]
Client Component SSR:
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/runtime/world.js [Client Component SSR]
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/serialization.js [Client Component SSR]
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/step/writable-stream.js [Client Component SSR]
./node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]/node_modules/@workflow/core/dist/index.js [Client Component SSR]
./node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@aws-sdk+client_9829537cd50594c6b8f43bea9dee5ca1/node_modules/@workflow/ai/dist/agent/durable-agent.js [Client Component SSR]
./node_modules/.pnpm/@[email protected][email protected][email protected][email protected]_@aws-sdk+client_9829537cd50594c6b8f43bea9dee5ca1/node_modules/@workflow/ai/dist/index.js [Client Component SSR]
./app/page.tsx [Client Component SSR]
./app/page.tsx [Server Component]
Next.js version: 16.0.10 (Turbopack)
Additional Info
Adding
experimental: {
optimizePackageImports: ['@workflow/ai'],
},
}
to next.config.ts makes the app work.
AlexGodard and gsathya
Metadata
Metadata
Assignees
Labels
No labels