diegomura / react-pdf

📄 Create PDF files using React
https://react-pdf.org
MIT License
15k stars 1.19k forks source link

@react-pdf/renderer 4.1.x requires scheduler #2956

Closed farseekers closed 1 week ago

farseekers commented 1 week ago

Describe the bug Trying to upgrade to @react-pdf/renderer 4.1.x (I tried 4.1.3 and 4.1.0), I see an error that 'scheduler' is missing.

To Reproduce Steps to reproduce the behavior including code snippet (if applies):

  1. In an empty directory, run npm install @react-pdf/renderer
  2. Create an index.js file containing

    import "@react-pdf/renderer";

  3. The end of the output from node index.js is then

    Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'scheduler' imported from /node_modules/@react-pdf/reconciler/lib/reconciler-31.js at packageResolve (node:internal/modules/esm/resolve:838:9) at moduleResolve (node:internal/modules/esm/resolve:907:18) at defaultResolve (node:internal/modules/esm/resolve:1037:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:650:12) at #cachedDefaultResolve (node:internal/modules/esm/loader:599:25) at ModuleLoader.resolve (node:internal/modules/esm/loader:582:38) at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:241:38) at ModuleJob._link (node:internal/modules/esm/module_job:132:49) { code: 'ERR_MODULE_NOT_FOUND' }

    Node.js v22.11.0

You can make use of react-pdf REPL to share the snippet

Expected behavior I don't expect a missing dependency. This doesn't occur with @react-pdf/renderer 4.0.2

Desktop (please complete the following information):

Thanks.

diegomura commented 1 week ago

You are absolutely right. Will fix. Thanks!

jstorm31 commented 1 week ago

Also get this error with version react-pdf/renderer@4.1.4

diegomura commented 1 week ago

Did the last version of @react-pdf/reconciler got installed? Maybe you need to clear node_modules or something

farseekers commented 5 days ago

Thanks very much for the fix!