2.7.570 breaks builds for React apps built with Create-React-App (CRA)
See original GitHub issueI am using React PDF Viewer, which is based on pdf.js at its core, within a React app created with CRA. Which basically means, that there is Webpack working under the hood, abstracted away through CRA.
Now everything works fine up to 2.6.347
, but starting with 2.7.570
and also with 2.8.335
I am running into this error:
./node_modules/pdfjs-dist/build/pdf.js 3657:145
Module parse failed: Unexpected token (3657:145)
File was processed with these loaders:
* ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| numPages: this._numPages,
| annotationStorage: (annotationStorage === null || annotationStorage === void 0 ? void 0 : annotationStorage.getAll()) || null,
> filename: ((_this$_fullReader = this._fullReader) === null || _this$_fullReader === void 0 ? void 0 : _this$_fullReader.filename) ?? null
| }).finally(() => {
| if (annotationStorage) {
I don’t expect anyone here to provide support for either the react package nor CRA. However, as I could clearly identify 2.7.570
as the “deal breaker”, I suspect there has been some change that makes a re-configuration of Webpack necessary?
Glad to receive any feedback that could help to shed some light on the root cause 😃
Thank you
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Create a New React App
Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any...
Read more >Don't use create-react-app: How you can set up your own ...
Create React App is a toolchain built and maintained by developers at Facebook for bootstrapping React applications. You simply run one command ...
Read more >STOP Using Create React App - YouTube
Create React App is a plague and we're here to cure it. Please use Vite, NextJS, or Remix instead. Seriously, anything is better...
Read more >Migrating a Create React App project to Vite - Darek Kay
Migrating a Create React App project to Vite ... Create React App (CRA) provides an all-in-one development toolchain for your React applications.
Read more >4 Reasons Why You Should Prefer Vite Over Create-React ...
Create React App (CRA) has long been the go-to tool for most developers to scaffold React projects and set up a dev server....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@aspnetde Ah, thank you, that clears it up. Another thing to add to the list that will only work with Webpack 5.
@dominik-bln See https://github.com/react-pdf-viewer/react-pdf-viewer/issues/499#issuecomment-819568264