-
Notifications
You must be signed in to change notification settings - Fork 12
feat: update dependencies and fix Cloudflare deployment #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: update dependencies and fix Cloudflare deployment #263
Conversation
## Dependencies Updated (15 packages) - @opennextjs/cloudflare: 1.3.1 → 1.11.0 (critical for deployment) - react: 19.1.0 → 19.2.0 - react-dom: 19.1.0 → 19.2.0 - All @radix-ui UI components (9 packages) to latest stable - axios: 1.7.9 → 1.12.2 - motion: 12.0.5 → 12.23.24 - wrangler: 4.22.0 → 4.43.0 ## Deployment Fixes - Added `export const runtime = "nodejs"` to 15+ pages/API routes to fix edge runtime compatibility - Updated wrangler.jsonc with correct worker name and service bindings - Removed R2 cache dependency from open-next.config.ts - Modified Sanity client to use CDN only in production ## Documentation - Added AGENTS.md with build commands, code style guidelines, and architecture notes ## Deployment Status ✅ Successfully deployed to Cloudflare Workers (requires Pro plan for 4.4MB bundle) ✅ All dependency updates completed without breaking changes⚠️ Local development has CORS issues with Sanity API (production works fine) ## Next Steps - Consider major updates: Next.js, Sanity, TailwindCSS (require individual testing) - Add localhost to Sanity CORS settings for local development - Monitor bundle size optimization opportunities
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Summary
This PR successfully modernizes the Redot website's deployment infrastructure by upgrading @opennextjs/cloudflare from 1.3.1 to 1.11.0 and fixing Cloudflare Workers compatibility issues. The changes enable successful deployment to Cloudflare Workers by adding runtime = "nodejs" to 15+ pages and API routes, addressing edge runtime incompatibilities.
Key changes:
- Updated 15 dependencies including React 19.1.0 → 19.2.0, all
@radix-uicomponents, motion, and wrangler - Removed R2 cache configuration (temporary until main Cloudflare account access is granted)
- Simplified Cloudflare worker configuration in
wrangler.jsonc - Added
output: "standalone"to Next.js config for proper bundling - Updated Sanity client to only use CDN in production
Critical issue found:
- axios version 1.12.2 specified in
package.jsondoes not exist (latest is 1.7.x series)
Confidence Score: 2/5
- This PR cannot be merged as-is due to invalid axios version that will cause installation failures
- The axios version typo (1.12.2 instead of 1.7.12 or similar) is a critical blocker that will prevent
npm installorbun installfrom working. All other changes appear sound and well-tested, but this syntax error must be fixed before merging package.jsonrequires immediate attention to fix the invalid axios version
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| package.json | 2/5 | Updated 15 dependencies including critical @opennextjs/cloudflare upgrade, but axios version 1.12.2 does not exist |
| wrangler.jsonc | 4/5 | Removed R2 bucket and service bindings, simplified worker name to redot-website |
| open-next.config.ts | 4/5 | Removed R2 incremental cache configuration, now uses memory-based caching |
| next.config.ts | 5/5 | Added output: "standalone" for Cloudflare deployment compatibility |
| app/api/download/route.ts | 5/5 | Changed runtime from edge to nodejs for Cloudflare Workers compatibility |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant Build as Next.js Build
participant OpenNext as OpenNext Cloudflare
participant Worker as Cloudflare Worker
participant Assets as Cloudflare Assets
participant Sanity as Sanity CMS
Dev->>Build: npm run build
Build->>Build: Compile Next.js app (standalone output)
Build->>Build: Add runtime="nodejs" to pages/routes
Dev->>OpenNext: opennextjs-cloudflare build
OpenNext->>OpenNext: Bundle worker.js
OpenNext->>OpenNext: Extract static assets
OpenNext->>OpenNext: Configure memory-based cache (no R2)
Dev->>OpenNext: opennextjs-cloudflare deploy
OpenNext->>Worker: Deploy worker.js (4.4MB)
OpenNext->>Assets: Deploy static assets
Worker->>Worker: Initialize with nodejs_compat flag
Note over Worker: Runtime Execution
Worker->>Worker: Execute nodejs runtime routes
Worker->>Sanity: Fetch content (useCdn in production)
Sanity-->>Worker: Return CMS data
Worker->>Assets: Serve static files
Worker-->>Dev: Return response
23 files reviewed, 1 comment
| "@sanity/vision": "3", | ||
| "@tabler/icons-react": "^3.22.0", | ||
| "axios": "^1.7.9", | ||
| "axios": "^1.12.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: axios version 1.12.2 does not exist - the latest version is 1.7.x. This appears to be a typo (likely meant 1.7.12 or similar)
| "axios": "^1.12.2", | |
| "axios": "^1.7.12", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 46:46
Comment:
**syntax:** axios version 1.12.2 does not exist - the latest version is 1.7.x. This appears to be a typo (likely meant 1.7.12 or similar)
```suggestion
"axios": "^1.7.12",
```
How can I resolve this? If you propose a fix, please make it concise.|
the bots gone crazy |




Summary
Dependencies Updated
Deployment Fixes
export const runtime = "nodejs"to fix edge runtime compatibilityResolves
Next Steps
Status
✅ All dependency updates completed without breaking changes
⚠️ Local CORS issues with Sanity (production works fine)
✅ Successfully deployed and functional