Skip to content

Fetch request just hangs #80

@wardy484

Description

@wardy484

Hi,

I'm trying to debug an issue where a request I'm trying to make to grab some markup just hangs and I can't figure out why. It is worth noting that this request works just fine when using Dio straight from dart. Other requests to the same website also resolve successfully from the JS environment.

My dart code:

JsEvalResult searchRequest = js.evaluate("$src.getChapters(`$id`);");
var newResult = await js.handlePromise(searchRequest);

The offending JS:

export const getChapters = async (mangaId: string): Promise<IChapters> => {
    console.log("starting");

    try {
        const results = await fetch(`${MF_URL}/manga/${mangaId}`);
        
        console.log(await results.text());
        return parseChaptersResult(await results.text(), mangaId);

    } catch (e) {
        console.log("err");
        console.log(e);
    }

    return { chapters: [] };
}

It's worth noting that the JS begins to process just fine as that first console.log executes but the promise never appears to resolve, it could also be worth noting that the response is quite a significant html page. For example, the request seems to resolve on a page that's 5.5kb but just hangs when the page is 21kb? At the moment that's the only obviously differenatiator I've got.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions