Skip to content

Commit 099d187

Browse files
committed
fix: TypeError: handler is not a function
1 parent cae34c7 commit 099d187

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)