File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
nextjs-ecommerce-oneclick/pages/api Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ export default async function startBuy(req, res) {
18
18
// Workflows will be started in the "default" namespace unless specified otherwise
19
19
// via options passed the Client constructor.
20
20
const client = new Client ( { connection } ) ;
21
+
22
+ // When the project is built, the bundler will strip out Workflow function names.
23
+ // This ensures the workflow type remains the same
24
+ // when the client send the request to Temporal Server. Another option is modifying the webpack config,
25
+ // as it is stated here https://docs.temporal.io/dev-guide/typescript/debugging#production-bundling
26
+ Object . defineProperty ( OneClickBuy , 'name' , { value : 'OneClickBuy' } ) ;
27
+
21
28
// kick off the purchase async
22
29
await client . workflow . start ( OneClickBuy , {
23
30
taskQueue : 'ecommerce-oneclick' ,
You can’t perform that action at this time.
0 commit comments