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.

2.7.570 breaks builds for React apps built with Create-React-App (CRA)

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dominik-blncommented, Apr 15, 2021

@aspnetde Ah, thank you, that clears it up. Another thing to add to the list that will only work with Webpack 5.

Read more comments on GitHub >

github_iconTop 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 >

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