You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am new to web development, so there may be a simple resolution for this, but thus far I have not found one.
I am creating a website for a company using Vite + ReactJS. Everything has been going well so far until this point. I am trying to add a newsfeed that pulls articles from CoinTelegraph. From my research, the best method to add this would be using RSS. After researching how to parse the RSS and use it, I began writing the code for this.
After simply using import Parser from "rss-parser";, if get this error:
After doing some research and finding others with a similar error, I am finding out the most probable issue is that 'rss-parser' is designed to work with the CommonJS module, whereas Vite uses ESM by default. I am hearing that using require instead of import may help with this issue, but when I use the 'require' function, I get an error that 'require' is not a defined function.
I am pretty lost and not sure how to proceed. Does anyone have a solution they can share?
Thank you.
The text was updated successfully, but these errors were encountered:
I am not entirely sure about this, however I believe it would be better to have your server (nodejs) use this library and send a call request to your server from your ReactJS app.
Hello,
I am new to web development, so there may be a simple resolution for this, but thus far I have not found one.
I am creating a website for a company using Vite + ReactJS. Everything has been going well so far until this point. I am trying to add a newsfeed that pulls articles from CoinTelegraph. From my research, the best method to add this would be using RSS. After researching how to parse the RSS and use it, I began writing the code for this.
After simply using
import Parser from "rss-parser";
, if get this error:After doing some research and finding others with a similar error, I am finding out the most probable issue is that 'rss-parser' is designed to work with the CommonJS module, whereas Vite uses ESM by default. I am hearing that using require instead of import may help with this issue, but when I use the 'require' function, I get an error that 'require' is not a defined function.
I am pretty lost and not sure how to proceed. Does anyone have a solution they can share?
Thank you.
The text was updated successfully, but these errors were encountered: