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

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

Closed
0xinhua opened this issue May 26, 2022 · 10 comments
Closed
Labels
bug Something isn't working 🔨 p3-minor-bug

Comments

@0xinhua
Copy link

0xinhua commented May 26, 2022

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

@0xinhua 0xinhua changed the title The requested module does not provide an export named 'createDefu' 【nuxt/bridge】The requested module does not provide an export named 'createDefu' May 26, 2022
@0xinhua 0xinhua changed the title 【nuxt/bridge】The requested module does not provide an export named 'createDefu' nuxt/bridge: The requested module does not provide an export named 'createDefu' May 26, 2022
@0xinhua 0xinhua changed the title nuxt/bridge: The requested module does not provide an export named 'createDefu' bridge: The requested module does not provide an export named 'createDefu' May 26, 2022
@dzcpy
Copy link

dzcpy commented May 27, 2022

Same issue

@MelvinSnijders
Copy link

Same issue here!

@felix-berlin
Copy link

Same issue 😞

@danielroe danielroe transferred this issue from nuxt/framework May 30, 2022
@felix-berlin
Copy link

Just got this running. Either you install the package defu manually to the devDependencies or you delete the package-lock.json file, delete all node_modules and run npm i again.

@MelvinSnijders
Copy link

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.

@0xinhua
Copy link
Author

0xinhua commented May 30, 2022

Just got this running. Either you install the package defu manually to the devDependencies or you delete the package-lock.json file, delete all node_modules and run npm i again.

@felix-berlin thanks, but I don't think is a good idea to installing it manually,It is referenced by some other package

@stursby
Copy link

stursby commented Jun 1, 2022

Had the same issue... per @MelvinSnijders comment, adding defu worked!

yarn add defu --dev

@danielroe
Copy link
Member

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

@danielroe danielroe added bug Something isn't working 🔨 p3-minor-bug and removed pending triage labels Jul 4, 2022
@lazbeta
Copy link

lazbeta commented Feb 29, 2024

same issue

@wattanx
Copy link
Collaborator

wattanx commented Apr 4, 2024

It seems to be resolved, so I close it.
Reopen is welcome.

@wattanx wattanx closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🔨 p3-minor-bug
Projects
None yet
Development

No branches or pull requests

8 participants