1
votes

I'm using next js 8 version in relation with react. Also using Apollo and Graphql. But I don't think that problem is in Apollo or Graphql. I have _document.js file in my pages folder. But when using Router.back() I have error about fetch api webpack and cors request. Actual problem is like this in browser console:

Fetch API cannot load webpack://%5Bname%5D_%5Bchunkhash%5D/./node_modules/react/cjs/react.development.js?. URL scheme must be "http" or "https" for CORS request.

1

1 Answers

0
votes

I think you are calling an endpoint without the protocol, for example you are doing

fetch('localhost:3000/my-endpoint')

You need to set put the http or https

fetch('http://localhost:3000/my-endpoint')