Skip to content

Commit 3d06303

Browse files
authored
Merge pull request #6538 from Shopify/fd-fix-cf-turnstile
[3.86] [Theme] Avoid running cf turnstile in local dev
2 parents 77b6f54 + 12db9e6 commit 3d06303

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

.changeset/few-schools-chew.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/theme': patch
3+
---
4+
5+
Mock captcha and api-collect requests in CLI proxy.

packages/theme/src/cli/utilities/repl/evaluator.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ export interface EvaluationConfig {
1717
}
1818

1919
export async function evaluate(config: EvaluationConfig): Promise<string | number | undefined> {
20-
try {
21-
return evaluateSnippet(config)
22-
23-
// eslint-disable-next-line no-catch-all/no-catch-all, @typescript-eslint/no-explicit-any
24-
} catch (error: any) {
25-
outputInfo(outputContent`${outputToken.errorText(error.message)}`)
26-
outputDebug(error.stack || 'Error backtrace not found')
27-
}
28-
}
29-
30-
async function evaluateSnippet(config: EvaluationConfig): Promise<string | number | undefined> {
3120
return (
3221
(await evalResult(config)) ||
3322
(await evalContext(config)) ||

packages/theme/src/cli/utilities/theme-environment/proxy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const IGNORED_ENDPOINTS = [
2727
'/web-pixels@',
2828
'/wpm',
2929
'/services/',
30+
'/api/collect',
31+
// Cloudflare's turnstile challenge #6416
32+
'/cdn-cgi/challenge-platform',
3033
]
3134

3235
const SESSION_COOKIE_NAME = '_shopify_essential'

0 commit comments

Comments
 (0)