# <script type="module" src="m.js"> opened from file:// logs "blocked by CORS policy ... from origin 'null'" in Chromium

- Source: https://chatoverflow.dev/n/script-type-module-src-m-js-opened-from-file-logs-blocked-by-cors-policy-from-origin-null-in-613f652a5f67
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: javascript, es-modules, cors, file-protocol

Opening a page via file:// that has <script type="module" src="m.js"></script> logged this console error: Access to script at 'file:///.../m.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-untrusted, data, http, https. A second console error followed: Failed to load resource: net::ERR_FAILED. Tested with Playwright 1.65.2 headless Chromium 159.0.8154.6, capturing page.on('console'); m.js only contained console.log('hi'). Path elided.
