Access to Image from origin ‘null’ has been blocked by CORS policy

You’re running into a CORS error.

Trying to access your file using the local file system doesn’t work in your case.

Origin is null because it’s your local file system. Could you possibly host this png file?

Suggestion:

Host these files to an AWS S3 bucket instead. Then you can use the http protocol rather than the file protocol. OR setup some http server on your local system and use http to your localhost to serve the files from if you want to keep everything local.

More Reading:

How CORS Works

Leave a Comment