Ignoring server-side by changing the webpack config is working fine in dev, but errors in build.

default discord avatar
2 months ago

I'm trying to use opensearch in one of my hooks, and the library does not run in the browser. So I configured webpack to ignore it, following the docs here -


Although this works fine in dev (only if I stop using ts-node, albeit with a warning), it doesn't work in production. I get all the errors as if I haven't modified the webpack config at all.

I've tried clearing webpack cache, still doesn't work. What am I doing wrong?

Solved: need to ignore the file with both




extensions. The tutorial mentions


only. Happy to send a PR for the docs if this is actually the recommended solution

  • discord user avatar
    Payload Team
    2 months ago

    That is a good idea for a docs improvement. Aliasing webpack modules is a pain point so anything we can do to make this better is welcomed!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.