Hello,
let me just say that developing with payload is awesome! Tried quite a few "cms"es and payload is so far the best to work with. I just got one issue at which I am stuck for several hours now actually.
I am getting this error on production build:
TypeError: Cannot call a class as a function
It goes away after I remove all the instances of getPayloadClient().
This is the whole error message:
TypeError: Cannot call a class as a function
at _class_call_check (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:91:15)
at new PgSelectQueryBuilder (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:40680:17)
at PgSelect._createSuperInternal (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:376:30)
at new PgSelect (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:40855:37)
at PgSelectBuilder.from (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:40660:111)
at E:\dev\metering-services\metering-website.next\server\chunks\6737.js:9129:40
at step (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:461:23)
at Object.next (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:402:20)
at asyncGeneratorStep (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:62:28)
at _next (E:\dev\metering-services\metering-website.next\server\chunks\6737.js:80:17)
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
digest: '1006470278'
}
Any idea what to do here?
EDIT: I should mention that I am working with next-payload. Heard that it's quite a stressful thing to develop on it, but the local api is must have at this point for me :D