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.

Using with files with disabled CORS

See original GitHub issue

I want to play sound from Amazon S3 from bucket where I don’t have access to change CORS.

When I create <audio> without this library then it works

<audio>
  <source src={url} type="audio/ogg"/>
</audio>

How I use ReactAudioPlayer:

<ReactAudioPlayer src={url}/>

It renders:

<audio class="react-audio-player " id="" preload="metadata" src="__URL__">
  <p>
    <!-- react-text: 508 -->Your browser does not support the <!-- /react-text --> 
    <code>audio</code><!-- react-text: 510 --> element.<!-- /react-text -->
  </p>
</audio>

Error:

Failed to load https://s3-eu-west-1.amazonaws.com/…: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://…’ is therefore not allowed access.

Is this bug or I just can’t use this library without changing CORS?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
justinmccommented, Sep 17, 2018

@kkshyu thanks for following up and glad you got this fixed! Hopefully it will help other people with the same problem.

0reactions
kkshyucommented, Sep 14, 2018

@justinmc thx for your reply

I use create-react-app development server and browse on Chrome. In the console, i will see like this: image

i just realize the problem. It is not about RAP. Actually firebase should be setup up the cors.json to make js in server load the resource. Thanks for your insight!

here is the reference: https://stackoverflow.com/questions/37760695/firebase-storage-and-access-control-allow-origin/37765371#37765371

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable same origin policy in Chrome - Stack Overflow
Create a shortcut on your desktop · Right-click on the shortcut and click Properties · Edit the Target property · Set it to...
Read more >
What is CORS? - SimpleLocalize
To disable CORS checks in Google Chrome, you need to close the browser and start it with the --disable-web-security and --user-data-dir flags.
Read more >
Run Chrome browser without CORS - Aleksandr Filatov
Where are you trying to run this command "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu -- ...
Read more >
How to run Google Chrome without CORS - Code4IT
You may need to run Google Chrome with CORS checks disabled. Here's how you can do it on Windows 10.
Read more >
Cors Issue. How to disable Cors in Chrome. | by Yulia Y.
Cors Issue. How to disable Cors in Chrome. · Install the gem: gem install rack-cors; Update your config/application.rb file by adding this:.
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