惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Martin Fowler
Martin Fowler
GbyAI
GbyAI
P
Palo Alto Networks Blog
N
Netflix TechBlog - Medium
C
Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
A
About on SuperTechFans
PCI Perspectives
PCI Perspectives
Scott Helme
Scott Helme
TaoSecurity Blog
TaoSecurity Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
K
Kaspersky official blog
W
WeLiveSecurity
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
月光博客
月光博客
N
News | PayPal Newsroom
Microsoft Azure Blog
Microsoft Azure Blog
G
GRAHAM CLULEY
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Know Your Adversary
Know Your Adversary
博客园 - Franky
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Full Disclosure
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
Forbes - Security
Forbes - Security
Attack and Defense Labs
Attack and Defense Labs
MyScale Blog
MyScale Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Tor Project blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
WebLLM Works in Dev But Fails on Vercel: The CSP Directive You're Missing
Michael Stel · 2026-05-07 · via DEV Community

WebGPU was detected, the consent dialog appeared, the user granted consent, and the network tab showed a clean 200 OK on the WASM fetch. Then nothing. No console output, no progress events. The UI showed "Enhanced analysis unavailable. Try again." In npm run dev, against the same code on the same browser, everything worked.

I almost spent an afternoon on the wrong theory. The reason I didn't is the reason for this post.

When you're debugging, anomalies are easier to chase than absences. The 200 OK had a body of 0.3 KB, which is anomalous for a binary asset that should be a few megabytes. The console was silent, which is an absence. I led with the anomaly. That was the mistake.


The Wrong Hypothesis

The 0.3 KB number had a tidy explanation. A Git LFS pointer file is roughly 130 bytes plus HTTP overhead. raw.githubusercontent.com is well known for not serving LFS content from some repos: instead of redirecting to media.githubusercontent.com (which actually serves the binary), it returns the pointer text. If you fetch what you think is a 50 MB asset and get back 130 bytes of YAML-looking text, that's why.

The story almost wrote itself. WebLLM downloads the WASM. The WASM is actually an LFS pointer. The worker tries to call WebAssembly.instantiateStreaming() on the pointer text, fails immediately, and the fallback chain swallows the error. Plausible, mechanical, and it explained both the response size and the silent failure.

It was also wrong.

I pulled the .gitattributes from mlc-ai/binary-mlc-llm-libs/main. The entire file:

app-release.apk filter=lfs diff=lfs merge=lfs -text
mlc-chat.apk filter=lfs diff=lfs merge=lfs -text

Enter fullscreen mode Exit fullscreen mode

Two lines. Only .apk files are LFS-tracked. WASM files are stored as regular Git blobs, which means raw.githubusercontent.com serves them directly with no pointer indirection. The theory was elegant and irrelevant.

This took thirty seconds to disprove. I'd been ready to spend hours on it.

The 0.3 KB number itself is still unexplained. Most likely a transient, a misread, or a path that 404'd with a small body served as 200 by an intermediary. Once the actual bug was fixed, the file fetched at the expected size and never showed up small again.

The lesson was sitting in plain sight the whole time. The console was silent. Silent. Not silent-after-an-error, not silent-with-a-warning, but silent across an entire failure path that was supposed to log progress events, then a model load completion, then inference timing. None of those fired. The anomaly told me where the bytes went. The absence told me the worker never got far enough to log anything.

If I'd led with the absence, I would have been looking for "what stops a worker from logging anything at all" within minutes. Instead I spent an hour on a theory about a domain I happened to find interesting.


The Actual Bug

The CSP deployed to Vercel, abridged:

default-src 'self';
script-src 'self' https://analytics.example.com;
worker-src 'self' blob:;
connect-src https://analytics.example.com
            https://huggingface.co
            https://*.huggingface.co
            https://raw.githubusercontent.com;

Enter fullscreen mode Exit fullscreen mode

Notice what's missing from script-src. From MDN:

By default, if a CSP contains a default-src or a script-src directive, then a page won't be allowed to compile WebAssembly using functions like WebAssembly.compileStreaming(). The wasm-unsafe-eval keyword can be used to undo this protection.

WebLLM's worker calls WebAssembly.instantiateStreaming() on the model_lib WASM as part of engine initialization. With no 'wasm-unsafe-eval' in script-src, the browser refuses to compile and throws a CompileError inside the worker. The worker's onerror is caught by the CoachingProvider fallback chain, which is designed to fail gracefully: WebLLM fails, try Ollama, then fall back to rule-based. The architecture was handling errors correctly. The errors should not have been swallowed in the first place.

There were no diagnostic logs because every one of them was gated on import.meta.env.DEV and stripped from the production build. I'd treated error-path logging as production noise, which is the same as not having it.

The fix is one directive:

script-src 'self' 'wasm-unsafe-eval' https://analytics.example.com;

Enter fullscreen mode Exit fullscreen mode

The directive is narrower than 'unsafe-eval' and is the safe choice for this case. The fix worked.


Why This Pattern is Treacherous

Three things composed to hide the failure.

The dev/prod CSP asymmetry is structural. Vite's dev server doesn't apply vercel.json headers. Any CSP-gated capability is unrestricted locally and enforced remotely. The same code path produces different runtime behavior across environments. "Works on my machine" is the literal truth.

Worker errors don't surface like main-thread errors. They propagate only through the worker's onerror event. If something catches that event for graceful degradation, the error is invisible unless the catch block logs it.

Production console hygiene fights you. Stripping logs is a defensible default, but error-path logs are not noise. They're the only signal that lets you debug failures users are actually hitting. When a try/catch lives inside a fallback handler, the catch block's logging is production-relevant even when the surrounding info logs aren't.

Each of these alone is benign. The intersection makes a failure mode that's invisible from both ends: no error in the user's UI, no error in the developer's console, no error in the deploy logs. The bug was actively being handled correctly by code that didn't know it was the bug.


What Changed After

Three changes landed in the fix PR.

The CSP directive. One line in vercel.json. Adding 'wasm-unsafe-eval' to script-src permits WebAssembly compilation and nothing else. WASM runs in its own sandbox, has no DOM access, and can only call back into JavaScript through imports the host page explicitly provides. It's the directive CSP3 added specifically so libraries like WebLLM wouldn't have to ask for 'unsafe-eval', which is genuinely riskier.

Removed import.meta.env.DEV gating from error-path logs in the WebLLM worker and the CoachingProvider fallback chain. Info and progress logs stay DEV-gated. Errors and fallback transitions surface in production. The principle, now written into the project conventions doc: gating an error log on DEV is the same as not having it. Treat it as the exception that needs justification, not the default.

Wired CSP violation reporting through Umami custom events. The securitypolicyviolation event fires regardless of whether report-to is configured in the CSP. Subscribing in the main entry point routes future violations into existing analytics:

document.addEventListener('securitypolicyviolation', (e) => {
  if (window.umami) {
    window.umami.track('csp-violation', {
      directive: e.violatedDirective,
      blockedURI: e.blockedURI,
      effectiveDirective: e.effectiveDirective,
    });
  }
});

Enter fullscreen mode Exit fullscreen mode

No new infrastructure. The next CSP issue will be diagnosable in seconds.


The Takeaway

If you're debugging a WebLLM failure that works in dev and fails silently on Vercel, the answer is almost certainly 'wasm-unsafe-eval'. That's the practical takeaway.

The deeper one: when something fails, look at what's missing before you look at what's strange. Anomalies attract attention because they're concrete. You can hold a 0.3 KB response in your head and build theories about it. Absences are harder to notice because they're, by definition, not there. But the absence is usually the more honest signal. The anomaly tells you something happened. The absence tells you something didn't, which is closer to where the failure actually lives.

The thirty-second check almost always exists. Run it.


I'm building Holocron, a browser-based combat log analyzer for Star Wars: The Old Republic. The earlier WebLLM spike post covers why I chose this stack. Holocron is free and requires no install — try it at holocronparse.com.