Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ca3aae4

Browse files
committed
Ensure initialisation complete before dispose()ing, closes #341
1 parent cb3efd5 commit ca3aae4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/core/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,10 @@ export class MiniflareCore<
11191119
}
11201120

11211121
async dispose(): Promise<void> {
1122+
// Ensure initialisation complete before disposing
1123+
// (see https://github.com/cloudflare/miniflare/issues/341)
1124+
await this.#initPromise;
1125+
11221126
// Run dispose hooks
11231127
for (const [name] of this.#plugins) {
11241128
const instance = this.#instances?.[name];

0 commit comments

Comments
 (0)