@Moksh I added an another fix. It should work now.
https://github.com/discourse/discourse/commit/618a7ecb35828e562b73aeadeb1b80c89c154e5d