Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
richtera opened this issue Oct 15, 2022 · 2 comments
Open

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

richtera opened this issue Oct 15, 2022 · 2 comments

Comments

@richtera
Copy link

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 }

@welcome
Copy link

welcome bot commented Oct 15, 2022

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@richtera
Copy link
Author

It looks like the internal version is using "version": "3.0.0" of native-fetch which still has an export default of fetch. 4.0.2 no longer does.

@richtera richtera changed the title Problem when importing fetch Problem when importing fetch in new version of native-fetch Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant