Skip to content

Commit 859706d

Browse files
committed
fix(wrangler): default worker entrypoint suport with wrangler types
1 parent 0595018 commit 859706d

File tree

1 file changed

+2
-2
lines changed
  • packages/wrangler/src/type-generation

1 file changed

+2
-2
lines changed

packages/wrangler/src/type-generation/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,13 @@ export async function generateEnvTypes(
464464
: undefined;
465465

466466
const exportExists = serviceEntry?.exports?.some(
467-
(e) => e === service.entrypoint
467+
(e) => e === (service.entrypoint ?? "default")
468468
);
469469

470470
let typeName: string;
471471

472472
if (importPath && exportExists) {
473-
typeName = `Service<import("${importPath}").${service.entrypoint ?? "default"}>`;
473+
typeName = `Service<typeof import("${importPath}").${service.entrypoint ?? "default"}>`;
474474
} else if (service.entrypoint) {
475475
typeName = `Service /* entrypoint ${service.entrypoint} from ${service.service} */`;
476476
} else {

0 commit comments

Comments
 (0)