question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading local file with `local-resource://` throws CORS error

See original GitHub issue

Hi 👋

I’m following the documentation and registered a file protocol to load local files without having to set webSecurity: false.

But I get this CORS error: Access to audio at 'yiddishe-kop-protocol:///Users/.../Library/Application Support/jkaraoke-desktop/blob/9' from origin 'http://localhost:8080' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, https.

Here is a link to my background.js file. And a link to my <audio> element that is trying to use the protocol.

For now I’ll just be setting webSecurity: false, but this is strongly discouraged

Environment: System: OS: macOS 10.15.6 CPU: (8) x64 Intel® Core™ i7-6920HQ CPU @ 2.90GHz Binaries: Node: 12.18.1 - /usr/local/opt/node@12/bin/node Yarn: 1.19.2 - ~/.npm/bin/yarn npm: 6.14.4 - ~/.npm/bin/npm npmPackages: @ant-design-vue/babel-helper-vue-transform-on: 1.0.1 @vue/babel-helper-vue-jsx-merge-props: 1.0.0 @vue/babel-plugin-transform-vue-jsx: 1.1.2 @vue/babel-preset-app: 4.5.4 @vue/babel-preset-jsx: 1.1.2 @vue/babel-sugar-functional-vue: 1.1.2 @vue/babel-sugar-inject-h: 1.1.2 @vue/babel-sugar-v-model: 1.1.2 @vue/babel-sugar-v-on: 1.1.2 @vue/cli-overlay: 4.5.4 @vue/cli-plugin-babel: ~4.5.0 => 4.5.4 @vue/cli-plugin-pwa: ~4.5.0 => 4.5.4 @vue/cli-plugin-router: ~4.5.0 => 4.5.4 @vue/cli-plugin-vuex: ~4.5.0 => 4.5.4 @vue/cli-service: ~4.5.0 => 4.5.4 @vue/cli-shared-utils: 4.5.4 @vue/component-compiler-utils: 3.1.2 @vue/preload-webpack-plugin: 1.1.1 @vue/web-component-wrapper: 1.2.0 portal-vue: ^2.1.7 => 2.1.7 vue: ^2.6.11 => 2.6.11 vue-class-component: 7.2.3 vue-cli-plugin-electron-builder: ~1.4.6 => 1.4.6 vue-hot-reload-api: 2.3.4 vue-loader: 15.9.2 (16.0.0-beta.3) vue-property-decorator: 8.5.1 vue-router: ^3.2.0 => 3.3.2 vue-slider-component: ^3.2.5 => 3.2.5 vue-style-loader: 4.1.2 vue-template-compiler: ^2.6.11 => 2.6.11 vue-template-es2015-compiler: 1.9.1 vuex: ^3.4.0 => 3.5.1 vuex-electron: ^1.0.3 => 1.0.3 npmGlobalPackages: @vue/cli: 4.2.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Yiddishe-Kopcommented, Aug 31, 2020

@D4RKAR117 It doesn’t seem to fix the issue. I still get the same CORS error.

0reactions
no-response[bot]commented, Oct 9, 2020

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Cross origin requests are only supported for HTTP." error ...
One way it worked loading local files is using them with in the project folder instead of outside your project folder.
Read more >
Reason: CORS request not HTTP - MDN Web Docs
Loading a local file. Local files from the same directory and subdirectories were historically treated as being from the same origin. This meant ......
Read more >
not allowed to load local resource flask - You.com
I'm trying to upload and display images on local storage but am getting errors stating that the site is not allowed to load...
Read more >
Loading local data to webapp with liberty - Forums - IBM Support
One of my HTML files tries to load data from the local file system via img tag () and fails due to what...
Read more >
How to allow cross origin request for local files? - Vivaldi Forum
I would like to use Vivaldi to browse local files in addition to web ... https. foo/bar/baz/index.html: 1 Failed to load resource: net:: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found