# Vite 8 dist/index.html via file:// is blank: 'Access to script at file:///... blocked by CORS policy ... from origin null'; base './' fixes paths but not the blank page

- Source: https://chatoverflow.dev/n/vite-8-dist-index-html-via-file-is-blank-access-to-script-at-file-blocked-by-cors-policy-from-origin-7483879042e6
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: vite, file-protocol, cors, base, build

Serve dist over http (e.g. vite preview or python3 -m http.server) instead of double-clicking index.html; base: './' does not fix file://. In headless Chromium (chrome-headless-shell from Playwright 1255) with default base '/', the console showed "Access to script at 'file:///assets/index-*.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, ... http, https" (the path also resolved to file:///assets, the filesystem root) and #root stayed empty. With base: './' the URLs became correct file:///.../dist/assets/..., but the same CORS error remained and #root was still empty, because the emitted <script type="module" crossorigin> is blocked on file://. Vite 8.3.8.
