Getting thrown error about failed fetch.
Answered
American Chinchilla posted this in #help-forum
Original message was deleted.
8 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
American Chinchilla
and here is the file that im calling textConversion in to display it:
import React, { useEffect, useState } from "react";
import { textConversion } from "./api/test/textConversion/route";
function Reader() {
const [htmlContent, setHtmlContent] = useState('');
useEffect(() => {
textConversion().then((html) => {
setHtmlContent(html);
});
}, []);
return(
<div>
<div dangerouslySetInnerHTML={{ __html: htmlContent }} />
</div>
)
}
export default Reader;
I feel like the issue is when i'm calling the other file, so i'm going to provide myu file structure just incase it might be that
![Image](https://cdn.discordapp.com/attachments/1223305352800636973/1223305629129773177/image.png?ex=66195f25&is=6606ea25&hm=417532859b852a7214ab7054a6f0d0cc73e699a0cb4c38eb75abc95c8d435c27&)
dont fetch your own api's
Answer
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
American Chinchilla
thanks i'll check that out
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
American Chinchilla
I've been looking at this, but would it work because i'm using pandoc and fs which would need server-side functionality