Axios error while deploying the nextjs project
Unanswered
rohit0904_01 posted this in #help-forum
i have been trying to deploy my nextJS project and have been facing some problems with fetching of data from an api, i have tried axios as well as fetch methods and both work locally and not upon deployment, i have also tried adding async headers, creating a proxy nodejs server and nothing seems to work, the error message is:
Access to fetch at 'https://pro-api.coinmarketcap.com/**api**/' from origin 'https://mydomain.com' 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.
if i am using headers in my next config file with output export then it show error in building the project
Can someone help me out
Access to fetch at 'https://pro-api.coinmarketcap.com/**api**/' from origin 'https://mydomain.com' 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.
if i am using headers in my next config file with output export then it show error in building the project
Can someone help me out