Skip to content

Commit eef8912

Browse files
fix: fix Cloudflare Workers CI build by resolving typescript peer dependency
The Cloudflare Workers CI build was failing due to an ERESOLVE error related to a conflicting typescript peer dependency in `react-scripts`. This commit updates `wrangler.toml` to add `--legacy-peer-deps` to the frontend `npm install` build command, allowing the build to bypass the conflict and compile successfully. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 14b654b commit eef8912

3 files changed

Lines changed: 18 additions & 27 deletions

File tree

frontend/package-lock.json

Lines changed: 6 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@
1212
"build": "react-scripts build"
1313
},
1414
"browserslist": {
15-
"production": [">0.2%", "not dead", "not op_mini all"],
16-
"development": ["last 1 chrome version", "last 1 firefox version"]
15+
"production": [
16+
">0.2%",
17+
"not dead",
18+
"not op_mini all"
19+
],
20+
"development": [
21+
"last 1 chrome version",
22+
"last 1 firefox version"
23+
]
1724
},
1825
"devDependencies": {
26+
"@types/node": "^25.6.0",
1927
"@types/react": "^18.2.0",
2028
"@types/react-dom": "^18.2.0",
2129
"react-scripts": "5.0.1",
22-
"typescript": "^4.9.0"
30+
"typescript": "^5.0.4"
2331
},
2432
"proxy": "http://localhost:8080"
2533
}

wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ compatibility_flags = ["nodejs_compat"]
99
# Installs frontend deps and builds the SPA so frontend/build exists before
1010
# `wrangler deploy` uploads assets. NODE_OPTIONS is required for
1111
# react-scripts 5.x + Node 18+ (webpack 4 OpenSSL 3.0 compatibility).
12-
command = "cd frontend && npm install --include=dev && GENERATE_SOURCEMAP=false CI=false NODE_OPTIONS=--openssl-legacy-provider npm run build"
12+
command = "cd frontend && npm install --include=dev --legacy-peer-deps && GENERATE_SOURCEMAP=false CI=false NODE_OPTIONS=--openssl-legacy-provider npm run build"
1313

1414
# ─── Static Assets (React SPA build output) ──────────────────────────────────
1515
# Built by `npm run build` (root package.json) before every `wrangler deploy`.

0 commit comments

Comments
 (0)