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) {
1818 // Workflows will be started in the "default" namespace unless specified otherwise
1919 // via options passed the Client constructor.
2020 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+
2128 // kick off the purchase async
2229 await client . workflow . start ( OneClickBuy , {
2330 taskQueue : 'ecommerce-oneclick' ,
You can’t perform that action at this time.
0 commit comments