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.

create-react-app can't minify parser.js

See original GitHub issue

Hi there,

Having a problem with the library building from create-react-app from v3.0.0 onwards. 2.12.1 is fine. On running npm run build, I get:

> react-scripts build

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

 	./node_modules/rss-parser/lib/parser.js:16

Read more here: http://bit.ly/2tRViJ9

Looks like an ES5/ES6 issue?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

11reactions
n7bestcommented, Feb 14, 2018

@nikomc0 encounter the same issue while using create-react-app.

What I did to solve around is to import the pre-compiled version directly and use the RSSParser instead of Parse and I also have to declare eslint global namespace to avoid the create-react-app build errors.

/* global RSSParser */
import 'rss-parser/dist/rss-parser.min.js';

let parser = new RSSParser();

also, I tried to add module property to the package.json which pass the build but since two version has different parser naming, it wasn’t working properly.

3reactions
cgpomeroycommented, Jun 3, 2018

Can someone explain further how to implement @n7best 's workaround? I’ve tried the below with no success.

captura de pantalla de 2018-06-03 00-45-48

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to minify react application to production - Stack Overflow
I'm having issued generate a production build of the react application and have this error. Failed to minify the code from this file:...
Read more >
What Does Create-React-App Actually Do? | by Andrew Mc
First is the scripts. These will probably be familiar as start, build, test, and eject. These scripts are actually located in the same...
Read more >
Terser vs. Uglify vs. babel-minify: Comparing JavaScript ...
See how Terser compares to UglifyJS and babel-minify. ... Terser is a JavaScript parser and mangler/compressor toolkit for ES6+.
Read more >
react-scripts-plugin-no-minify | Yarn - Package Manager
Disable build minification in your CRA app's build output. Install. yarn add -D react-scripts-plugin-no-minify. Add to cra.config.js
Read more >
How To Set Up a React Project with Create React App
But now, Create React App includes all the JavaScript packages you ... run a build to create a fully minified version of your...
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