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.

/node_modules/defu/dist/defu.mjs' does not provide an export named 'createDefu'

See original GitHub issue

Environment

Nuxt project info: 16:41:33


  • Operating System: Darwin
  • Node Version: v16.13.0
  • Nuxt Version: 3.0.0-27495976.e31c604
  • Package Manager: npm@8.1.0
  • Builder: vite
  • User Config: modules, sitemap, vue, privateRuntimeConfig, publicRuntimeConfig, css, buildModules, build
  • Runtime Modules: ~/modules/sitemap
  • Build Modules: @nuxtjs/tailwindcss@5.0.2, @pinia/nuxt@0.1.8

Reproduction

Describe the bug

after update return this error

 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'

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
pi0commented, Apr 12, 2022

Thanks for sharing the output. v5 seems to be hoisted because of unocss > defu. (/cc @antfu)

In the meantime, as a workaround you can directly add defu dependency to your project.

0reactions
antfucommented, Apr 12, 2022

Upgrading UnoCSS to v0.31.1 should fix this problem. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"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 >
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 >
vue 2.7 the requested module does not provide an export ...
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 >
Common Issues - Nuxt Vite
Uncaught SyntaxError: The requested module ... does not provide an export named 'default'. Vite has an issue for pre-bundling dependencies ...
Read more >
Snowpack - The requested module '/web_modules/recoil.js ...
Uncaught SyntaxError: The requested module '/web_modules/recoil.js' does not provide an export named 'RecoilRoot'. I will talk about how to ...
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