Vscode-live-server: How can I enable CORS (Cross-Origin Resource Sharing) ?

Created on 24 Jan 2018  路  10Comments  路  Source: ritwickdey/vscode-live-server

Failed to load http://xxxxxx.com//assets/i18n/it.json: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:5500' is therefore not allowed access.

closed

Most helpful comment

It seems like CORS still isn't enabled on the local server. I tested using test-cars.org and returns an error when trying to GET one of the files from the server. Any additional steps I'm missing? Anything that needs to be enabled in the settings?

All 10 comments

This features is already added in v3.1.0. (Sorry, I forget to close it)

It seems like CORS still isn't enabled on the local server. I tested using test-cars.org and returns an error when trying to GET one of the files from the server. Any additional steps I'm missing? Anything that needs to be enabled in the settings?

I still can't access .json files from external domains. Am I forgetting to set something up?

acao

screen shot 2019-01-16 at 21 56 04
I have also encountered a CORS issue when trying to request a API, are you sure that you have CORS enabled ?

I'm using Safari version 11.1.2

the endpoint is
https://www.cryptocompare.com/api/data/coinlist

Using 5.4.0, I'm getting the same problem when trying to call https://api.flickr.com/services . This is with Firefox.

Same issue here in Chrome, Firefox and Edge on Windows 10.
Is there anything we need to configure before this would work? Thanks!

Edit: I seem to have fixed my issue by simply loosening the CORS settings on my target resource. Now I don't get any errors anymore regarding a missing 'Access-Control-Allow-Origin' header.

Hey I have the same issue when using d3.js. How to fix this issue?

d3.html('http://enable-cors.org')
  .get((err, data) => {
    console.log(data)
  })

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kmdrGroch picture kmdrGroch  路  5Comments

julesmqz picture julesmqz  路  7Comments

mpower02 picture mpower02  路  6Comments

Er-rchydy picture Er-rchydy  路  3Comments

abhiinos111abhi picture abhiinos111abhi  路  5Comments