urql: Can't import the named export 'makeFetchBody' from non EcmaScript module (only default export is available)

It’s me again with a new error

[ error ] ./node_modules/@urql/exchange-multipart-fetch/dist/urql-exchange-multipart-fetch.mjs
[1] Can't import the named export 'makeFetchBody' from non EcmaScript module (only default export is available)
[1] Could not find files for /en/movement/new in .next/build-manifest.json
[1] Could not find files for /en/movement/new in .next/build-manifest.json
[1] ModuleDependencyError: Can't import the named export 'makeFetchBody' from non EcmaScript module (only default export is available)

Versions: “urql”: “1.9.7”, “@urql/exchange-graphcache”: “2.3.5”, “@urql/exchange-multipart-fetch”: “0.1.5”,

(Did a reinstall after the new release of @urql/core)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 22 (8 by maintainers)

Most upvoted comments

FYI, I kept getting the same issue as @BjoernRave, and not even the upgrade to @urql/core@1.11.4 and @urql/exchange-graphcache@2.3.8 resolved it for me.

However, adding the following to my webpack config seemed to fix the issue:

module: {
  rules: [
    {
      test: /\.mjs$/,
      include: /node_modules/,
      type: 'javascript/auto'
    }
  ]
}

The weird thing is that I tried to manually specify the extension, but that did not help.

I will try to create a minimal reproduction, and will open a separate ticket.

Sorry about this! I finally found what caused our broken builds and #734 fixed it. That’s released as @urql/core@1.11.4 and @urql/exchange-graphcache@2.3.8. The broken releases have been marked as deprecated (or deleted where possible) on npm.

 ❯ yarn list --pattern urql                                                                               [17:11:52]
yarn list v1.21.1
├─ @urql/core@1.11.3
├─ @urql/exchange-multipart-fetch@0.1.5
└─ urql@1.9.7
Done in 0.82s.

Still seeing it, but it’s no bother. Quickly wanted to say that this is a really, really, really awesome library, so thank you all for your work!!!

Can you have a look at running @urql/core@1.11.3 please? That should fix this issue. yarn upgrade @urql/core should do the trick.