Hello and thanks for your work, Payload is GREAT!
I get some strange error. When we inside collection custom UI components and some nodejs libs like @hapi/iron used in custom routes or acces rules then this server-only deps bundled inside browser too and break front-end and console full of errors like Buffer is undefined... Maybe someone already encountered this type of errors and have a solution?
I've got a few posts on this. What I'd do is set up files that use these server-only modules and alias them in the webpack config.
The latter link is where I found the solution 🙂
Thanks you a lot!
Let me know if you run into any issues. Been down that rabbit hole 🙂
Still no success... I finded the page about it in docs
https://payloadcms.com/docs/admin/webpack#aliasing-server-only-modulesand trying to do it like described, but anyway my server dependency bundled in browser js.
looks like i still missing something...
After clearing the webpack cache I have errors about that my modules not found inside collection file.
Looks like I maked it works by removing file extension inside path.resolve, I don't know if this correct because in docs paths point to file name with extension.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.