I have a node app bundled with webpack which I am trying to deploy to cloud run. In order to be able to load a file more than 32 MB (the set limit) in cloud run I added the header ('Transfer-encoding' : 'chunked') to the webpack config file. (The file is a min.js file ,the minified version of the website and is loaded upon hitting the url).
Locally everything runs fine but when this change is deployed on cloud run, it gives the follwoing error upon clicking on the app url after it is deployed:
(502 error)
"upstream connect error or disconnect/reset before headers. reset reason: protocol error"
I have disabled the http2 end-to-end option in deployment.
Here is the webpack file where the header is added
webpack.config.js
devServer: {
contentBase: path.resolve(__dirname, 'build'),
host: '0.0.0.0',
port: process.env.PORT || 8601,
sockPort: 'location',
disableHostCheck: true,
devServer: {
headers: {
'Transfer-encoding': 'chunked',
},
},
}