-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create-react-app can't minify parser.js #53
Comments
Thanks for the report. We did switch to ES6 in 3.0.0 From the bit.ly link, it says "ask that the package be published pre-compiled". We have a pre-compiled version in |
Was in a bit of a hurry, so I just downgraded to 2.12.1 which works absolutely fine and got me moving. Will have a go at importing the file directly when I get a chance at the weekend and report back. Thanks for the quick reply! 👍 |
I've got a noob question. Im not quite sure exactly how to properly import the min version. |
What client technology are you using? At the root of the project, run:
It's then in node_modules/rss-parser/dist/rss-parser.min.js. How and where you include that in your pages then depends what client framework you're using (i.e.React, Angular etc). |
It should be |
@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 /* 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. |
Thanks @n7best. Any tips on how we can change rss-parser to better support create-react-app? |
Had the same issue for a Travis CI integration of an app created with create-react-app. The Travis log says
The create-react-app README argues the package should be published pre-compiled to ES5 (not ES6). |
I tried switching to babel-preset-env, but it gives the same result as babel-preset-2015 The code generated by babel (everything in |
Any news about a solution for this? Just noticed the same problem and came searching some answers. |
Yea CRA doesn't seem to transpile external dependencies to ES5. It has to be precompiled. workaround from @n7best works fine now. |
Jumping in on this thread after noticing the same issue, will use the workaround for now. |
I will also use the workaround for now |
Can someone explain further how to implement @n7best 's workaround? |
I was able to implement in my create-react-app. I'm using Axios to fetch the page data.
|
Using the suggestion from @415DomSmith I got the example to work without the need for axios
|
@cgpomeroy |
Hi @bobby-brennan, thanks for your great RSS Parser. Everything works fine in development, but I get the same "Failed to minify the code from this file: ./node_modules/rss-parser/lib/parser.js:16" error message when building my project. The workaround (importying the minified version) is not working as I get this error message : RSSParser() is not a constructor. By any chance, did you manage to identify what the issue is, or at least do you recommend a specific workaround to solve this issue? |
I would try using the file in |
If i am using Your method i am getting a compile time error of
please help me to resolve this |
@415DomSmith solution worked for me! The only difference is that I had to use the cors proxy. |
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:
Looks like an ES5/ES6 issue?
The text was updated successfully, but these errors were encountered: