Skip to content

Typescript definitions don't work #72

@dwickern

Description

@dwickern

If you import fetch from 'fetch', typescript won't resolve it.
If you import fetch from 'ember-fetch', typescript will resolve it, but you'll have a runtime error.

When you import fetch, typescript looks in node_modules/fetch. It won't scan the whole node_modules directory for anyone exporting a fetch module. You can work around this with an explicit path mapping in tsconfig.json, but it's not conventional.

Maybe this package could export ember-fetch, and eventually deprecate fetch?

/cc @toranb @chriskrycho

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions