From a4b51fc462018d2202a38302f0e894186c2e68c6 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Wed, 3 Jan 2024 19:31:23 -0300 Subject: [PATCH 1/2] fix(open-next): use dynamic import handler for monorepo entrypoint --- packages/open-next/src/build.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/open-next/src/build.ts b/packages/open-next/src/build.ts index a184e56d..c9a7dc53 100755 --- a/packages/open-next/src/build.ts +++ b/packages/open-next/src/build.ts @@ -735,7 +735,12 @@ function addMonorepoEntrypoint(outputPath: string, packagePath: string) { const packagePosixPath = packagePath.split(path.sep).join(path.posix.sep); fs.writeFileSync( path.join(outputPath, "index.mjs"), - [`export * from "./${packagePosixPath}/index.mjs";`].join(""), + [ + `export const handler = async (event, context) => {`, + ` const fn = await import("./${packagePosixPath}/index.mjs");`, + ` return fn.handler(event, context);`, + `};`, + ].join(""), ); } From 2a93bef635dd3806fac3b78c9121f9747d320f78 Mon Sep 17 00:00:00 2001 From: Dorseuil Nicolas Date: Fri, 5 Jan 2024 16:41:04 +0100 Subject: [PATCH 2/2] changeset --- .changeset/moody-camels-help.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/moody-camels-help.md diff --git a/.changeset/moody-camels-help.md b/.changeset/moody-camels-help.md new file mode 100644 index 00000000..be2bc8c5 --- /dev/null +++ b/.changeset/moody-camels-help.md @@ -0,0 +1,5 @@ +--- +"open-next": patch +--- + +use dynamic import handler for monorepo entrypoint