Skip to content

Commit 71432dd

Browse files
authored
fix(remix): Make sure the domain is created before running. (#6852)
1 parent b83e7e1 commit 71432dd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/remix/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PlaywrightTestConfig } from '@playwright/test';
22

33
const config: PlaywrightTestConfig = {
4-
retries: 2,
4+
retries: 0,
55
timeout: 12000,
66
use: {
77
baseURL: 'http://localhost:3000',

packages/remix/src/utils/instrumentServer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ function wrapRequestHandler(origRequestHandler: RequestHandler, build: ServerBui
391391

392392
return async function (this: unknown, request: RemixRequest, loadContext?: unknown): Promise<Response> {
393393
const local = domain.create();
394+
395+
// Waiting for the next tick to make sure that the domain is active
396+
// https://github.com/nodejs/node/issues/40999#issuecomment-1002719169
397+
await new Promise(resolve => setImmediate(resolve));
398+
394399
return local.bind(async () => {
395400
const hub = getCurrentHub();
396401
const options = hub.getClient()?.getOptions();

0 commit comments

Comments
 (0)