Uncaught Error: Cannot find module './zlib_bindings'

I have an NPM dependency on ‘zlib’: ‘1.0.5’. When I add this dependency I get this error:

modules-runtime.js?hash=23fe92393aa44a7b01bb53a510a9cab5fb43037c:232 Uncaught Error: Cannot find module ‘./zlib_bindings’
at makeMissingError (modules-runtime.js?hash=23fe92393aa44a7b01bb53a510a9cab5fb43037c:232)
at Module.require (modules-runtime.js?hash=23fe92393aa44a7b01bb53a510a9cab5fb43037c:251)
at require (modules-runtime.js?hash=23fe92393aa44a7b01bb53a510a9cab5fb43037c:268)
at module (myapp.js?hash=b6fff2f5cfd1e644c28ccffe3bcbb20c339a13d8:161)
at fileEvaluate (modules-runtime.js?hash=23fe92393aa44a7b01bb53a510a9cab5fb43037c:346)
at Module.require (modules-runtime.js?hash=23fe92393aa44a7b01bb53a510a9cab5fb43037c:248)
at require (modules-runtime.js?hash=23fe92393aa44a7b01bb53a510a9cab5fb43037c:268)
at webpackUniversalModuleDefinition (myapp.js?hash=b6fff2f5cfd1e644c28ccffe3bcbb20c339a13d8:131)
at module (myapp.js?hash=b6fff2f5cfd1e644c28ccffe3bcbb20c339a13d8:181)
at fileEvaluate (modules-runtime.js?hash=23fe92393aa44a7b01bb53a510a9cab5fb43037c:346)

Any ideas how to address it are welcome, thank you.

Looks like you try to import a node server module to the client, correct?

It happens with @react-pdf/renderer which relies on polyfill in the browser as well