You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have installed CKAN and PortalJs in local both are working. But I am getting following error in the Home screen while loading stats: e.g. Access to fetch at 'http://localhost:5000/api/3/action/package_search?rows=0' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. I have added following in the lab/apolloClient.ts: const restLink = new RestLink({ uri: getConfig().publicRuntimeConfig.DMS + '/api/3/action/', headers: { 'Access-Control-Allow-Origin':'*', 'Access-Control-Allow-Credentials':'true', 'Accept':'application/json', 'Accept-Language':'en-US', 'Content-Language':'en-US', 'Content-Type': 'application/json', 'mode': 'no-cors', 'Access-Control-Allow-Methods':'GET,POST,OPTIONS,DELETE,PUT', 'Referrer-Policy':'no-referrer', 'Connection':'Keep-Alive', 'Access-Control-Allow-Headers':'Origin, X-Requested-With, Content-Type, Accept',
},
But still it showing CORS related issue. Well in home page I can see recent dataset from CKAN but seeing issue getting data for search related data only.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,

I have installed CKAN and PortalJs in local both are working. But I am getting following error in the Home screen while loading stats:
e.g. Access to fetch at 'http://localhost:5000/api/3/action/package_search?rows=0' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I have added following in the lab/apolloClient.ts:
const restLink = new RestLink({
uri: getConfig().publicRuntimeConfig.DMS + '/api/3/action/',
headers: {
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Credentials':'true',
'Accept':'application/json',
'Accept-Language':'en-US',
'Content-Language':'en-US',
'Content-Type': 'application/json',
'mode': 'no-cors',
'Access-Control-Allow-Methods':'GET,POST,OPTIONS,DELETE,PUT',
'Referrer-Policy':'no-referrer',
'Connection':'Keep-Alive',
'Access-Control-Allow-Headers':'Origin, X-Requested-With, Content-Type, Accept',
},
But still it showing CORS related issue. Well in home page I can see recent dataset from CKAN but seeing issue getting data for search related data only.
Please share solution.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions