Skip to content

Problem when importing fetch in new version of native-fetch #216

@richtera

Description

@richtera

module.exports = require('native-fetch')

When using the browser compile of this, the system ultimately imports "native-fetch" but the API of native-fetch doesn't have fetch as the default export, but rather as { fetch } on the exports.

The implementation is here https://github.com/achingbrain/native-fetch/blob/master/src/index.js
So either this code should be changed to not use default here

const { Response, Request, Headers, default: fetch } = require('../fetch')

Or request native-fetch to export fetch as default in addition to { fetch }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions