Rollup "browser" build includes "Node.js" dependencies
Describe the bug The following is included in the bundle when building a browser bundle with rollup.
import require$$1$1 from 'events';
To Reproduce See workspace - https://stackblitz.com/edit/node-9tjqve?file=dist/index.js
Expected behavior No Node.js dependencies included in the bundle when building a browser bundle with rollup.
Which react-pdf version are you using?
3.0.0 The issue is recreated here https://stackblitz.com/edit/node-9tjqve?file=dist%2Findex.js
Agree that this is an issue, I'm using Vite which uses Rollup under the hood. Found an easy workaround thankfully. Just install the events package from npm which someone had the foresight to create. It's just a browser compatible version of the Node one.
https://www.npmjs.com/package/events
If anyone is having this issue still, I solved it by using the rollup-plugin-polyfill-node plugin.