"export 'default' (imported as 'defu') was not found in 'defu'
See original GitHub issue(as the other issue closed, maybe this one is a different case)
Sorry for the delay in testing the new version. It seems that new release 5.13.5
makes nuxt render the page properly, but now when visiting the page after npm run dev
, the following error appears on chrome console:
Please note that:
- I ran
npm update
and indeed I’m running version5.13.5
- from package-lock.json:
"@nuxtjs/axios": {
"version": "5.13.5",
"resolved": "https://registry.npmjs.org/@nuxtjs/axios/-/axios-5.13.5.tgz",
"integrity": "sha512-GyeuiseDCwfRGDQH/gK+lngCseZS3SQm3q6xqiVx5xQnzCqokojN3uJkNB0DdHCowBP1aim+mDhu3spzcCnyBg==",
"requires": {
"@nuxtjs/proxy": "^2.1.0",
"axios": "^0.21.1",
"axios-retry": "^3.1.9",
"consola": "^2.15.3",
"defu": "^5.0.0"
},
- Tried deleting both
node_modules
and.nuxt
to avoid some inconsistency issue - Tried switching between node 12 and 14 just in case
- At nuxt dev output it just shows this now:
"export 'default' (imported as 'defu') was not found in 'defu' friendly-errors 16:23:18
Also seen on Chrome console:
[HMR] bundle 'client' has 1 warnings
client.js?1b93:196 ./.nuxt/axios.js 73:31-35"export 'default' (imported as 'defu') was not found in 'defu'
This is happening on the same project that uses babel transpile for some reason (I think we should get rid of IE11 anyway).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Export default was not found - Stack Overflow
"What am I doing wrong?" You are trying to import the default export of a module which does not have a default export....
Read more >export 'render' (imported as 'render') was not found - You.com
The reason this is happening is because in Vue 2, Vue provides a default export export default vue , which allows BootstrapVue to...
Read more >nuxt-community - Bountysource
"export 'default' (imported as 'defu') was not found in 'defu' $ 0. Created 1 year ago in nuxt-community/axios-module with 7 comments. (as the...
Read more >defu | Yarn - Package Manager
defu. Assign default properties, recursively. Lightweight and Fast! ... 6.1.0 (2022-08-16). Features. export Defu type helper (#45 (551ae4c) ...
Read more >Introduction to Nuxt 3 modules - DEV Community
import defu from 'defu' import { resolve } from 'pathe' import { defineNuxtModule, addPlugin } from '@nuxt/kit' export default ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I cannot fix the issue with pnpm, npm, yarn.
To reproduce - clone this: https://github.com/antfu/vitesse-nuxt-bridge
Uncaught SyntaxError: The requested module ‘/_nuxt/node_modules/defu/dist/defu.cjs?import’ does not provide an export named ‘defu’ (at composables.mjs:3:10)
Hi,
I think i’ve found something important regarding this bug. It seems that switching npm for yarn would resolve the issue. That means that it must be related to dependency resolution.
I noticed that unlike the example sandbox from @pi0, the project that I’m working on doesn’t include
on it’s package.json
yarn
on the project without yarn.lock (because they use npm) would solve the bug.npm install
after that would make the error appear again.npm update
won’t fix the bug."defu": "^5.0.0"
to package.json and then runningnpm install
again solves the issue.What doesn’t work:
To reproduce:
"@nuxtjs/axios": "5.13.1",
(locked version)"@nuxtjs/axios": "^5.13.1",
npm update "@nuxtjs/axios"
so npm lockfile shows"version": "5.13.6",
"export 'default' (imported as 'defu') was not found in 'defu'
should appear nownpm install defu --save
and expect the error to be gonepackage-lock.json diff from the commented steps: