Skip to content

Replace got with alternative that doesn't depend on @types/node #109

@fern64

Description

@fern64

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)

Subject

I'm trying to build a [Remix}(https://github.com/remix-run/remix) application that is deployed to Cloudflare Pages. This is an environment that is not Node.js based. My application deploys successfully but tsc fails because the environment type declarations for the Cloudflare environment conflict with @types/node. But I don't even have @types/node installed. Or actually, I do. In my lockfile I find @remix-run/dev depends on xdm, which depends on got, which depends on @types/cacheable-request, which depends on @types/node ( which is cool, because cacheable-request is a Node.js library ). The two environment types ( @cloudflare/workers-types and @types/node ) conflict.

Problem

xdm depends on got and thus installs @types/node, which makes tsc fail in Cloudflare environments.

TODO

Solution

I would like to ask whether it would be possible to swap out got for an alternative that does not depend on @types/node I'd be happy to implement this change. I've checked and got is only used on one line in the project. It would be trivial to replace this with node-fetch-cache, which does not depend on @types/node.

Alternatives

There are alternative replacement libraries, but node-fetch-cache offers all the features we used from got and doesn't depend on @types/node.

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