As an alternate solution I just changed my db from postgres to mongodb and the build error went away, the error itself hasn't been solved but this is a good solution for long term.