Mostly about webpack polyfills. Everything fails to start when installing this package.
Hi @hayskapoy, can you share the errors you are getting?
Hello @tylandavis !
I'm getting this error in the browser console and the payload admin does not load
Uncaught ReferenceError: Buffer is not defined
And i am using this webpack aliases in my payload config
config.resolve.alias = {
...config.resolve.alias,
[path.resolve(__dirname, "services/neondb.js")]: mockModulePath,
[path.resolve(__dirname, "clients/neondb.js")]: mockModulePath,
}
hmm, your aliases look correct to me. I guess it would depend on how you are using the package. I've only used the aliasing with hooks, is that how you are using it or some other way?
Hi @tylandavis ! I finally got it working. I just followed what the payload website is using at
https://github.com/payloadcms/website-cms/blob/main/src/payload.config.tsBasically i needed to create emptyModuleMock.js (NOT
.ts
) not sure if the contents matter but i also copied it. Then i removed
.js
from
path.resolve
calls then it worked 😌
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.