question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bridge: The requested module does not provide an export named 'createDefu'

See original GitHub issue

Environment


  • Operating System: Darwin
  • Node Version: v14.16.0
  • Nuxt Version: 2.16.0-27358576.777a4b7f
  • Package Manager: npm@6.14.11
  • Builder: webpack
  • User Config: telemetry, hooks, mode, target, head, css, plugins, components, modules, build, srcDir, server, loading, render, publicRuntimeConfig, privateRuntimeConfig, proxy, serverMiddleware, router, bridge, buildModules
  • Runtime Modules: @nuxtjs/proxy@2.1.0, @nuxt/http@0.5.13, @nuxtjs/device@1.2.7, @nuxtjs/svg@0.1.12
  • Build Modules: @nuxt/bridge@3.0.0-27545203.75e046f

Reproduction

I use “@nuxt/bridge”: “npm:@nuxt/bridge-edge@^3.0.0-27454252.7bf338d” to upgrade nuxt2 to nuxt/bridge version

Need some helps when i use npm run dev run dev environment get The above error, thanks ~

Describe the bug

use npm i install packages and npm run dev run dev environment:

error logs:

 ERROR  [worker reload] [worker init] The requested module 'file:///Users/w/workspace/node_modules/defu/dist/defu.mjs' does not provide an export named 'createDefu'

  import { createDefu } from 'node_modules/defu/dist/defu.mjs';
  ^^^^^^^^^^
  SyntaxError: The requested module 'node_modules/defu/dist/defu.mjs' does not provide an export named 'createDefu'
  at ModuleJob._instantiate (internal/modules/esm/module_job.js:104:21)
  at async ModuleJob.run (internal/modules/esm/module_job.js:149:5)
  at async Loader.import (internal/modules/esm/loader.js:166:24)
  at async Object.loadESM (internal/process/esm_loader.js:68:5)

and use npm why defu :

✦ ❯ npm-why defu
  Who required defu:
  web > @nuxt/bridge > unplugin-vue2-script-setup > defu@5.0.1
  web > nuxt-edge > @nuxt/cli-edge > @nuxt/config-edge > defu@5.0.1
  web > nuxt-edge > @nuxt/cli-edge > defu@5.0.1
  web > nuxt-edge > @nuxt/config-edge > defu@5.0.1
  web > nuxt-edge > @nuxt/core-edge > @nuxt/config-edge > defu@5.0.1
  web > nuxt-edge > @nuxt/core-edge > @nuxt/server-edge > @nuxt/vue-renderer-edge > defu@5.0.1
  web > nuxt-edge > @nuxt/core-edge > @nuxt/server-edge > serve-placeholder > defu@5.0.1
  web > nuxt-edge > @nuxt/generator-edge > defu@5.0.1
  web > nuxt-edge > @nuxt/loading-screen > defu@5.0.1
  web > nuxt-edge > @nuxt/server-edge > @nuxt/vue-renderer-edge > defu@5.0.1
  web > nuxt-edge > @nuxt/server-edge > serve-placeholder > defu@5.0.1
  web > nuxt-edge > @nuxt/telemetry > defu@5.0.1
  web > nuxt-edge > @nuxt/vue-renderer-edge > defu@5.0.1

Additional context

No response

Logs

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:7
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
MelvinSnijderscommented, May 30, 2022

Deleting the package-lock.json and node_modules doesn’t fix it for me. However, installing defu manually does work, but that feels like a bad workaround.

1reaction
danielroecommented, Jul 4, 2022

For now, manually adding defu to your package.json is the right way to solve this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bridge: The requested module does not provide an export ...
Just got this running. Either you install the package defu manually to the devDependencies or you delete the package-lock.json file, delete all ...
Read more >
"The requested module ' does not provide an export named ...
You've confirmed that the package.json in the module's folder doesn't have "type": "module" in it. That's the issue. It's using the older ...
Read more >
the requested module 'vue' does not provide an export named ...
The reason it didn't work is that Vue provides a named export, whereas you are trying to import it as though it had...
Read more >
Requested module does not provide export named 'default'
To solve the error "The requested module does not provide an export named default", use the `default` keyword when exporting a value from...
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network ... PH32868, Exported ear file does not include latest application files....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found