'Google App Egine: No 'Access-Control-Allow-Origin' header is present on the requested resource

I am getting this error in my console. Node js Api with puppeteer deployed on google app engine

ftsYQ.png

What I tried on App.js:

Atempt 1 
var cors = require('cors')
app.use(cors());
app.options('*', cors());

Atempt 2

var cors = require('cors')

var corsOptions = {
  origin: 'APPLICATION A',
}

app.use(cors(corsOptions ));
app.options('*', cors());

Atempt 3

response.set({
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Methods': 'DELETE,GET,PATCH,POST,PUT',
        'Access-Control-Allow-Headers': 'Content-Type,Authorization'
    });

puppeteer Args

{ args: ['--no-sandbox','--disable-web-security','--disable-features=IsolateOrigins', '--disable-site-isolation-trials', '--disable-setuid-sandbox'], headless: false }
    

Googling it from 3-4 days but couldn't find solution. Kindly help me



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source