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.

An error about CORS of Image.

See original GitHub issue

When I update the last version PIXI in github dev branch, my demo can’t run. There is an error message about load image:

Access to Image at ‘file:///Users/rocky/DEV/www/test-pixi/client/test-mesh/required/assets/displacement_BG.jpg’ from origin ‘null’ has been blocked by CORS policy: Invalid response. Origin ‘null’ is therefore not allowed access.

I use chrome and with the args : --args --allow-file-access-from-files -enable-webgl --ignore-gpu-blacklist .

There is no problem in the version at commit 07eb79c4e4edb1cc4f52b7105e54ddd77868acdf

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
englercjcommented, Jul 22, 2017

As you can see in the error message the browser is blocking the image load because it is missing cross origin headers. The loader determined that the image was crossOrigin and set the value for you. You can either 1) Update the server to send the correct CORS headers so that you can do a crossOrigin load or 2) Change your crossOrigin param to empty string, which will “work” but will dirty the canvas and restrict you from performing certain potentially insecure actions (like reading pixels). Example of options 2: https://jsfiddle.net/vkww63ao/2/

1reaction
finscncommented, May 26, 2017

Oh! It’s chrome’s bug. The last dev version has fixed it .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing with image CORS error in Chrome, Chromium and ...
The issue comes from the way that Chromium caches the images. The way that the initial image is cached is - without the...
Read more >
Why does the editor throw a CORS error when processing an ...
The most likely cause of CORS errors is an incorrectly configured CORS policy on a remote server. A resource is deemed remote when...
Read more >
Allowing cross-origin use of images and canvas - HTML
HTML provides a crossorigin attribute for images that, in combination with an appropriate CORS header, allows images defined by the <img> ...
Read more >
Html <img src=...> works but JS Image loading cause CORS ...
I try to found solution my self (JS ES6) but find only-partially. We are able to load img from no-CORS support src into...
Read more >
Error cors · Issue #390 · tsayen/dom-to-image - GitHub
Hi guys I'm trying to generate the image of a tage img from my screen, but I'm having color problems, does anyone have...
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