Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
posible rechazo de promesa no manejado: "No se puede encontrar ningún elemento RSS en el feed

Encontré este error en otros lugares, pero no con la fuente RSS. De todos modos, estoy tratando de crear una aplicación de noticias con React Native usando fuentes RSS. Obtuve esta de "huffpost", estaba iniciando sesión principalmente en el navegador ( ya que es más fácil de usar para mí), obtuve los datos de la fuente RSS, los analicé:

 const getNews = async () => { fetch('https://peaceful-peak-58941.herokuapp.com/https://www.huffpost.com/section/front-page/feed?x=1') .then((response) => response.text()) .then((responseData) => rssParser.parse(responseData)) .then((rss) => { setArticles(rss.items) }); }

cuando lo registré, me di cuenta de que se registra dos veces, una cuando el estado aún está vacío (todavía no recibí ningún feed), luego la segunda vez es cuando obtengo el feed y los datos que necesito, estaba bien. ya que me sucedió antes en reactJs pero estaba "bien" en ese momento, ahora estaba como bien, déjame probar esto en un emulador móvil ... pero luego, en lugar de hacer lo mismo que en el navegador, simplemente sigue dándome el error "posible rechazo de promesa no manejado: "No se puede encontrar ningún elemento RSS en el feed", ¿por qué no muestra los datos ya que eventualmente debería obtener los datos? (lo intenté de nuevo en el navegador y parece funcionar) (usando expo si importa)

 {articles.length > 0 ? articles.map(article=>( <View key={article.id} style={{width:"100%"}}> <Text style={styles.title}>{article.title}</Text> <Image style={{width:'100%', height:"300px"}} source={{uri:`${article.enclosures[0].url}`}}/> <Text style={styles.description}>{article.description}</Text> </View> )) : <Text>...</Text>}
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Fetch recibirá OPCIONES primero y enviará los datos reales justo después de eso. Puede configurarlo para que pueda buscar sin las molestas OPCIONES. Simplemente agregue otro parámetro {method: 'get'} , en la función de fetch

 const getNews = async () => { fetch('https://peaceful-peak-58941.herokuapp.com/https://www.huffpost.com/section/front-page/feed?x=1', {method:'get'}) .then((response) => response.text()) .then((responseData) => rssParser.parse(responseData)) .then((rss) => { setArticles(rss.items) }); }
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!