Skip to content

Commit 8055c18

Browse files
authored
use a literal path to import the config (#618)
1 parent c5aa622 commit 8055c18

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/open-next/src/core/createGenericHandler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ export async function createGenericHandler<
3535
E extends BaseEventOrResult = InternalEvent,
3636
R extends BaseEventOrResult = InternalResult,
3737
>(handler: GenericHandler<Type, E, R>) {
38-
//First we load the config
39-
// @ts-expect-error
38+
// @ts-expect-error `./open-next.config.mjs` exists only in the build output
4039
const config: OpenNextConfig = await import("./open-next.config.mjs").then(
4140
(m) => m.default,
4241
);

packages/open-next/src/core/createMainHandler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ declare global {
3030
}
3131

3232
export async function createMainHandler() {
33-
//First we load the config
34-
const config: OpenNextConfig = await import(
35-
process.cwd() + "/open-next.config.mjs"
36-
).then((m) => m.default);
33+
// @ts-expect-error `./open-next.config.mjs` exists only in the build output
34+
const config: OpenNextConfig = await import("./open-next.config.mjs").then(
35+
(m) => m.default,
36+
);
3737

3838
const thisFunction = globalThis.fnName
3939
? config.functions![globalThis.fnName]

0 commit comments

Comments
 (0)