openknowledge-archive / dpr-api

DEPRECATED - Data Package Registry API and Frontend
http://frictionlessdata.io/
MIT License
7 stars 6 forks source link

For many datapackages, graph or table does not show up #193

Closed Fak3 closed 7 years ago

Fak3 commented 7 years ago

Affects at least 3 of 5 datapackages I tried: gdp, country-codes, coutry-list Go to https://staging.datapackaged.com/core/country-list The graph or table does not show up, and there are few errors in the browser console:

GET https://bits-staging-datapackaged.s3.amazonaws.com/static/dpr-js/vendor/plotly/plotly.min.js 
country-list:322 GET https://bits-staging-datapackaged.s3.amazonaws.com/static/dpr-js/vendor/plotly/plotly.min.js 404 (Not Found)
bundle.js:2 Download the React DevTools for a better development experience: https://fb.me/react-devtools
bundle.js:1 Warning: It looks like you're using a minified copy of the development build of React. When deploying React apps to production, make sure to use the production build which skips development warnings and is faster. See https://fb.me/react-minification for more details.e @ bundle.js:1o @ bundle.js:1(anonymous function) @ bundle.js:2(anonymous function) @ bundle.js:2t @ bundle.js:1(anonymous function) @ bundle.js:2t @ bundle.js:1(anonymous function) @ bundle.js:1t @ bundle.js:1(anonymous function) @ bundle.js:1(anonymous function) @ bundle.js:1
2country-list:1 XMLHttpRequest cannot load https://bits.staging.datapackaged.com/metadata/core/country-list/_v/latest/datapackage.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://staging.datapackaged.com' is therefore not allowed access.
bundle.js:21 Uncaught (in promise) Error: Network Error(…)e.exports @ bundle.js:21h.onerror @ bundle.js:21
bundle.js:21 Uncaught (in promise) Error: Network Error(…)
rufuspollock commented 7 years ago

FIXED. I encountered this too and believe have fixed with recent CORS work on devops.

Fetch API cannot load https://bits.staging.datapackaged.com/metadata/core/finance-vix/_v/latest/datapackage.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Solution: fixed the s3 CORS issue myself. I followed instructions here http://blog.celingest.com/en/2014/10/02/tutorial-using-cors-with-cloudfront-and-s3/ based on this google query

Comments: