Skip to content

Commit c78b177

Browse files
PatrickGRich-Harristeemingc
authored
fix: Webcontainer AsyncLocalStorage workaround throttle (#14526)
* don't reset `sync_store` and handle one request at a time * dry Promise.withResolvers * hardening webcontainer detection based on @webcontainer/env * Revert "hardening webcontainer detection based on @webcontainer/env" This reverts commit 0f5e744. * changeset * Update packages/kit/src/runtime/server/constants.js Co-authored-by: Tee Ming <[email protected]> * try this * move current --------- Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Tee Ming <[email protected]> Co-authored-by: Rich Harris <[email protected]>
1 parent 4769d16 commit c78b177

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/deep-insects-do.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: Webcontainer AsyncLocalStorage workaround

packages/kit/src/runtime/server/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import { set_app } from './app.js';
1313
/** @type {Promise<any>} */
1414
let init_promise;
1515

16+
/** @type {Promise<void> | null} */
17+
let current = null;
18+
1619
export class Server {
1720
/** @type {import('types').SSROptions} */
1821
#options;
@@ -31,9 +34,6 @@ export class Server {
3134
if (IN_WEBCONTAINER) {
3235
const respond = this.respond.bind(this);
3336

34-
/** @type {Promise<void> | null} */
35-
let current = null;
36-
3737
/** @type {typeof respond} */
3838
this.respond = async (...args) => {
3939
const { promise, resolve } = /** @type {PromiseWithResolvers<void>} */ (with_resolvers());

0 commit comments

Comments
 (0)