diff --git a/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts b/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts index 08aaa4f25a137..b041ffb8290e2 100644 --- a/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts +++ b/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts @@ -346,7 +346,7 @@ function rewriteToLocalhostIfNeeded(host: string): string { } export function rewriteOpenSSLErrorIfNeeded(error: Error): Error { - if (error.message !== 'unsupported') + if (error.message !== 'unsupported' && (error as NodeJS.ErrnoException).code !== 'ERR_CRYPTO_UNSUPPORTED_OPERATION') return error; return rewriteErrorMessage(error, [ 'Unsupported TLS certificate.', diff --git a/tests/playwright-test/babel.spec.ts b/tests/playwright-test/babel.spec.ts index 3fb0a1a725762..724a2a98ad04c 100644 --- a/tests/playwright-test/babel.spec.ts +++ b/tests/playwright-test/babel.spec.ts @@ -148,5 +148,5 @@ test('should not transform external', async ({ runInlineTest }) => { ` }); expect(result.exitCode).toBe(1); - expect(result.output).toContain('Cannot use import statement outside a module'); + expect(result.output).toMatch(/(Cannot use import statement outside a module|require\(\) of ES Module .* not supported.)/); });