question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack version inconsistency after `npm update`

See original GitHub issue

Before you start - checklist

  • I followed instructions in documentation written for my React-PDF version
  • I have checked if this bug is not already reported
  • I have checked if an issue is not listed in Known issues
  • If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo

Description

Whenever I run an npm update command to update other packages and after that I try an npm run start or npm run build I get following error message:

Screenshot 2021-12-20 at 09 28 41

The only way I currently found to fix this is to manually remove the node_modules folder and delete the package-lock.json file, uninstall react-pdf, run a clean npm install and only afterwards run once more npm i react-pdf. How can I fix this?

Steps to reproduce

  1. Install latest version
  2. Downgrade another package
  3. Run npm update
  4. Run npm run start or npm run build

Expected behavior

Should not have webpack inconsistency

Actual behavior

Screenshot 2021-12-20 at 09 28 41

Additional information

No response

Environment

- **Browser (if applicable)**: Version 98.0.4758.9 (Official Build) dev (arm64)
- **React-PDF version**: 5.6.0
- **React version**: 17.0.1
- **Webpack version (if applicable)**:

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
yuliya-ivaniukovichcommented, May 20, 2022

Note that peerDependencies are now installed by default in npm7+, so probably we also should mark the dependency as optional: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#peerdependenciesmeta

0reactions
martinbrooscommented, Nov 21, 2022

Ah i see I was using entry.webpack instead of entry.webpack5 . Thanks all working now 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

After upgrading npm, webpack errors showing - Stack Overflow
After I upgraded the npm package to the latest one, 8.2. 0 I started getting problems in react application. here is the screen...
Read more >
How I solved and debugged my Webpack issue through trial ...
My debugging journey started with the following setup: webpack.config.js // webpack v4.6.0 ... npm install webpack-serve --save-dev.
Read more >
webworkify-webpack - npm
webworkify-webpack. Generates a web worker at runtime from webpack's bundled modules with only the used dependencies.
Read more >
How to Use Semantic Versioning in NPM | heynode.com
If a version of a package is tagged in package.json to ^2.0.0 , and the latest version is 2.88.0 , version 2.88.0 will...
Read more >
Using webpack with TypeScript - LogRocket Blog
We'll also explore how to use webpack plugins. To follow along with this tutorial, you'll need the following: npm; Node.js: If you already...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found