## Summary Fixes #16900 - MS Office documents (doc, docx, ppt, pptx, xls, xlsx, odt) cannot be previewed when hosted on local/private networks. ## Problem Microsoft's Office Online viewer (`view.officeapps.live.com`) requires documents to be publicly accessible from the internet. For self-hosted Twenty instances or local development, files are not reachable by Microsoft's servers, causing the viewer to fail with "An error occurred". ## Solution Detect private/local URLs upfront and show a helpful message with a download button instead of letting the viewer fail silently. **Detected private URLs:** - `localhost`, `127.0.0.1`, `[::1]` - Private IP ranges: `10.x.x.x`, `172.16-31.x.x`, `192.168.x.x` - Local domain patterns: `.local`, `.localhost`, `.internal` ## Alternatives Explored (that don't work) We investigated more sophisticated detection approaches: 1. **postMessage events** - Microsoft's viewer doesn't send any error messages we can listen to 2. **Fetching the embed URL** - Blocked by CORS (Microsoft doesn't set `Access-Control-Allow-Origin`) 3. **Reading iframe content** - Cross-origin restrictions prevent JavaScript access The URL-based detection is the most reliable approach for catching the common cases where preview will definitely fail. ## Testing 1. Upload an Office file (docx, pptx, xlsx) on a local Twenty instance 2. Try to preview it 3. Should see "This file cannot be previewed because it is hosted locally" with a Download button
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See: 🚀 Self-hosting 🖥️ Local Setup
Does the world need another CRM?
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in Open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Recoil, Emotion and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




