"BREAKING CHANGE: webpack"

default discord avatar
joelcorey10 months ago
3

Not exactly sure what is going on with this but my project just crapped the bed with webpack errors. I installed the Facebook API npm package, but I don't think that is the cause.



https://webpack.js.org/configuration/resolve/#resolvefallback


"Webpack 5 no longer polyfills Node.js core modules automatically which means if you use them in your code running in browsers or alike, you will have to install compatible modules from npm and include them yourself. Here is a list of polyfills webpack has used before webpack 5:"



iiiiiiinteresting



Anyone else running in to this?

  • discord user avatar
    tylandavis
    10 months ago

    Hey @joelcorey, you might be using server-only modules, which Webpack is trying to bundle and is running into this error when trying to use them in the browser. Are you using any plugins or running any hooks that might be causing this?



    more on Webpack in Payload here:

    https://payloadcms.com/docs/admin/webpack#aliasing-server-only-modules
  • default discord avatar
    joelcorey10 months ago

    @tylandavis I do believe that this will solve it. I will go ahead and mark this one as answered. Thank you for your help.

  • discord user avatar
    tylandavis
    10 months ago

    Glad I could help! Let me know if you run into other issues with this and I’d be happy to help.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

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