Bolt api

CORS Preflight Request Timeout - OPTIONS Request Failing

POST or other non-simple requests fail because the CORS preflight OPTIONS request times out. Browser doesn't even send the actual request.

Requests work in some browsers but not others, or fail intermittently.

Error Messages You Might See

OPTIONS request timeout Preflight request failed No 'Access-Control-Allow-Methods' header CORS preflight failed
OPTIONS request timeoutPreflight request failedNo 'Access-Control-Allow-Methods' headerCORS preflight failed

Common Causes

  1. Server doesn't handle OPTIONS method
  2. OPTIONS request takes too long to respond
  3. Firewall blocking OPTIONS method
  4. CORS headers missing in OPTIONS response
  5. Preflight cache too short, requesting too frequently

How to Fix It

Ensure server responds to OPTIONS: if(request.method === 'OPTIONS') return new Response(null, { status: 200, headers: corsHeaders })

Response must include CORS headers: 'Access-Control-Allow-Methods', 'Access-Control-Allow-Headers', 'Access-Control-Max-Age'

Set long max-age: 'Access-Control-Max-Age': '86400' (24 hours)

Use middleware to add CORS to all routes

Real developers can help you.

Franck Plazanet Franck Plazanet I am a Strategic Engineering Leader with over 8 years of experience building high-availability enterprise systems and scaling high-performing technical teams. My focus is on bridging the gap between complex technology and business growth. Core Expertise: 🚀 Leadership: Managing and coaching teams of 15+ engineers, fostering a culture of accountability and continuous improvement. 🏗️ Architecture: Enterprise Core Systems, Multi-system Integration (ERP/API/ETL), and Core Database Structure. ☁️ Cloud & Scale: AWS Expert; architected systems handling 10B+ monthly requests and managing 100k+ SKUs. 📈 Business Impact: Aligning tech strategy with P&L goals to drive $70k+ in monthly recurring revenue. I thrive on "out-of-the-box" thinking to solve complex technical bottlenecks and am always looking for ways to use automation to improve business productivity. Victor Denisov Victor Denisov Developer Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure Simon A. Simon A. I'm a backend developer building APIs, emulators, and interactive game systems. Professionally, I've developed Java/Spring reporting solutions, managed relational and NoSQL databases, and implemented CI/CD workflows. BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Daniel Vázquez Daniel Vázquez Software Engineer with over 10 years of experience on Startups, Government, big tech industry & consulting. Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : )

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

What is preflight?

Browser sends OPTIONS request to check if server allows cross-origin request. Server responds with allowed methods/headers

How long should preflight cache?

Access-Control-Max-Age: 86400 (24 hours). Longer is better - fewer OPTIONS requests

Which requests need preflight?

Non-simple: PUT, DELETE, POST with custom headers. Simple: GET, HEAD, POST with form-data

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help