Skip to content

Commit fdd54a4

Browse files
authored
Merge pull request #18 from contentstack/fix/default-handler-issue
fix: TypeError: handler is not a function
2 parents cae34c7 + 099d187 commit fdd54a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/util/cloud-function/cloud-functions.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ export class CloudFunctions {
7171
): Promise<void> {
7272
await Promise.all(
7373
cloudFunctionResources.map(async (cloudFunctionResource) => {
74-
const handler = await import(
75-
`${cloudFunctionResource.cloudFunctionFilePath}`
76-
);
74+
// Import the cloud function dynamically using the import() syntax
75+
const { default: handler } = await import(
76+
`${cloudFunctionResource.cloudFunctionFilePath}`
77+
);
7778
app.use(express.json());
7879
app.use(express.urlencoded({ extended: true }));
7980

0 commit comments

Comments
 (0)