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

Module not found: Can't resolve 'unfetch' #172

Open
tungrix opened this issue Jul 7, 2023 · 2 comments
Open

Module not found: Can't resolve 'unfetch' #172

tungrix opened this issue Jul 7, 2023 · 2 comments

Comments

@tungrix
Copy link

tungrix commented Jul 7, 2023

I have followed the official instruction to install unfetch npm i unfetch; however, when I import fetch from 'unfetch', Module not found: Can't resolve 'unfetch' pop out, I am using latest version of Next.js.

@asins
Copy link

asins commented Jul 23, 2023

I also had the same issue and the solution was to change the 'exports' in the 'package.json' file to the following:

  "exports": {
    ".": {
      "import": "./dist/unfetch.mjs",
      "default": "./dist/unfetch.js"
    },

@waringr
Copy link

waringr commented Dec 8, 2023

At the risk of asking a dumb question, is that my package.json, or the one from isomorphic-unfetch? TIA

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

3 participants