-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
Following the "Durable chat sessions with Next.js, Workflow, and Redis" guide as written causes pnpm dev to fail during workflow bundling.
Versions:
- chat: 4.20.1
- @chat-adapter/slack: 4.20.1
- @chat-adapter/state-redis: 4.20.1
- workflow: 4.2.0-beta.70
- next: 16.1.6
The guide imports bot into workflows/durable-chat-session.ts and uses bot.reviver() inside the workflow. With the versions above, that pulls @chat-adapter/slack into the workflow bundle and fails with:
✘ [ERROR] You are attempting to use "@chat-adapter/slack" which depends on Node.js modules. Packages that depend on Node.js modules are not available in workflow functions.
lib/bot.ts:5:9:
5 │ slack: createSlackAdapter(),
│ ~~~~~~~~~~~~~~~~~~
╵ Move this function into a step function.
Expected:
- The docs example should work as written, or
- The guide should mention that
botcannot be imported into the workflow module and should only be used inside"use step"functions.
Workaround:
Keep the workflow on serialized thread/message data and only import @/lib/bot inside step functions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels