Invalid json response body (CORS related)

System Information
  • Strapi Version: 3.5.3
  • Operating System: hosted on Linux (Plesk) / requests from Windows/Linux
  • Database: MySQL
  • Node Version: 12.4.0
  • NPM Version: 6.9.0
  • Yarn Version: 1.22.10

I’m using Nuxt.js for the frontend. During the build, I must request my Strapi API. I do this request using node-fetch.
When running locally (on Windows), doing a request from localhost:3000 (dev or production) to localhost:1337 (dev) works.
However, if I try to request my API deployed in production mode, I get the following error:
ERROR invalid json response body at https://url/ reason: Unexpected token M in JSON at position 0
I searched on Internet to find out the cause and it could be related to CORS.
So I created a middleware at config/middleware.js:

module.exports = {
    settings: {
        cors: {
            enabled: true,
            headers: "*"
        }
    }
}

It still doesn’t work. I also tried with origin but I had issues with it.

It was only linked to node-fetch, it works with axios.