N
Nuxt5mo ago
Nerdnum

editor

Hi All I've been code very happilly for the whole day now, and even though I've not changed any dependencies, I now get the following error when running npm run dev:
ℹ Vite client warmed up in 3217ms
✘ [ERROR] No matching export in "node_modules/unicorn-magic/default.js" for import "toPath"
node_modules/globby/ignore.js:8:8:
8 │ import {toPath} from 'unicorn-magic';
╵ ~~~~~~
✘ [ERROR] No matching export in "node_modules/unicorn-magic/default.js" for import "toPath"
node_modules/globby/index.js:7:8:
7 │ import {toPath} from 'unicorn-magic';
╵ ~~~~~~
ℹ Vite client warmed up in 3217ms
✘ [ERROR] No matching export in "node_modules/unicorn-magic/default.js" for import "toPath"
node_modules/globby/ignore.js:8:8:
8 │ import {toPath} from 'unicorn-magic';
╵ ~~~~~~
✘ [ERROR] No matching export in "node_modules/unicorn-magic/default.js" for import "toPath"
node_modules/globby/index.js:7:8:
7 │ import {toPath} from 'unicorn-magic';
╵ ~~~~~~
The browser console shows the following error:
plugin.vue3.js:1

GET http://localhost:3000/_nuxt/@fs/Users/lbecker/Projects/projectx-frontend-v3/node_modules/.cache/vite/client/deps/pinia.js?v=9b31e98b net::ERR_ABORTED 504 (Outdated Optimize Dep)
customFetch.js:5

GET http://localhost:3000/_nuxt/@fs/Users/lbecker/Projects/projectx-frontend-v3/node_modules/.cache/vite/client/deps/@vueuse_core.js?v=bc366796 net::ERR_ABORTED 504 (Outdated Optimize Dep)
plugin.vue3.js:1

GET http://localhost:3000/_nuxt/@fs/Users/lbecker/Projects/projectx-frontend-v3/node_modules/.cache/vite/client/deps/pinia.js?v=9b31e98b net::ERR_ABORTED 504 (Outdated Optimize Dep)
customFetch.js:5

GET http://localhost:3000/_nuxt/@fs/Users/lbecker/Projects/projectx-frontend-v3/node_modules/.cache/vite/client/deps/@vueuse_core.js?v=bc366796 net::ERR_ABORTED 504 (Outdated Optimize Dep)
I've done npx nuxi cleanup, and reinstalled node_modules npm install, but the error persists. These workaround did not help, https://github.com/sindresorhus/globby/issues/260. Please help! Here is my nuxt.config.ts:
export default defineNuxtConfig({
ssr: false,
extends: ["@nuxt/ui-pro"],
modules: [
"@pinia/nuxt",
"@nuxt/ui", // ui config is in app.config.ts
"nuxt-tiptap-editor",
"nuxt-lodash",
"nuxt-file-storage",
"nuxt-anchorscroll",
"nuxt-file-storage",
"@nuxt/image",
],
image: {},
tiptap: {
prefix: "Tiptap",
},
future: {
compatibilityVersion: 4,
},
fileStorage: {
mount: process.env.FILE_STORAGE_LOCATION,
},

compatibilityDate: "2024-08-13",
devtools: { enabled: true },
runtimeConfig: {
public: {
xxxx,
},
},
});
export default defineNuxtConfig({
ssr: false,
extends: ["@nuxt/ui-pro"],
modules: [
"@pinia/nuxt",
"@nuxt/ui", // ui config is in app.config.ts
"nuxt-tiptap-editor",
"nuxt-lodash",
"nuxt-file-storage",
"nuxt-anchorscroll",
"nuxt-file-storage",
"@nuxt/image",
],
image: {},
tiptap: {
prefix: "Tiptap",
},
future: {
compatibilityVersion: 4,
},
fileStorage: {
mount: process.env.FILE_STORAGE_LOCATION,
},

compatibilityDate: "2024-08-13",
devtools: { enabled: true },
runtimeConfig: {
public: {
xxxx,
},
},
});
GitHub
Issues · sindresorhus/globby
User-friendly glob matching. Contribute to sindresorhus/globby development by creating an account on GitHub.
2 Replies
kapa.ai
kapa.ai5mo ago
Hi @Nerdnum. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry you're encountering this issue. Based on the error messages:
No matching export in "node_modules/unicorn-magic/default.js" for import "toPath"
No matching export in "node_modules/unicorn-magic/default.js" for import "toPath"
and
504 (Outdated Optimize Dep)
504 (Outdated Optimize Dep)
This appears to be a problem with Vite's dependency optimization cache, possibly related to a broken or incompatible dependency export in your node_modules (specifically unicorn-magic as used by globby). The 504 errors for Pinia and VueUse also suggest Vite's optimized dependency cache is out of sync or corrupted. What you've already tried: - npx nuxi cleanup - Reinstalling node_modules with npm install - Workarounds from the globby issue tracker Relevant information from the knowledge sources: - There are known issues in Nuxt 3 and Vite where dependency optimization can break, causing full page reloads or errors if dependencies are not properly optimized or exports are missing. Sometimes, dependencies need to be explicitly included in Vite's optimizeDeps.include option in your Nuxt config to avoid repeated optimization or cache issues. This is especially true for packages that are not ESM-friendly or have unusual export structures. See the suggestion here:
"try passing the dependencies that cause the reloads to vite's optimizeDeps include ... in your nuxt config"
Optimizing dependencies - Nuxt 3.8.1 - If you encounter ESM/CJS interop issues, you may need to alias or transpile problematic libraries in your Nuxt config.
Troubleshooting ESM Issues What you can try: 1. Explicitly include problematic dependencies in Vite's optimizeDeps:
export default defineNuxtConfig({
vite: {
optimizeDeps: {
include: ['unicorn-magic', 'globby']
}
}
})

export default defineNuxtConfig({
vite: {
optimizeDeps: {
include: ['unicorn-magic', 'globby']
}
}
})

2. Transpile or alias the problematic library:
export default defineNuxtConfig({
build: {
transpile: ['unicorn-magic']
},
alias: {
'unicorn-magic': 'unicorn-magic/dist/unicorn-magic.cjs.js' // adjust path as needed
}
})

export default defineNuxtConfig({
build: {
transpile: ['unicorn-magic']
},
alias: {
'unicorn-magic': 'unicorn-magic/dist/unicorn-magic.cjs.js' // adjust path as needed
}
})

3. Clear Vite's cache manually:
Delete the .nuxt, node_modules/.cache, and node_modules folders, then reinstall:
rm -rf node_modules .nuxt node_modules/.cache
npm install
npx nuxi prepare
npm run dev

rm -rf node_modules .nuxt node_modules/.cache
npm install
npx nuxi prepare
npm run dev

If these steps do not resolve the issue, it's possible that a recent update to one of your dependencies (even a transitive one) introduced a breaking change. In that case, you may need to pin versions or investigate recent changes in the unicorn-magic or globby packages. If the problem persists, please provide more details about your dependency versions or consider creating a minimal reproduction for further debugging. Let me know if you need more help! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5mo ago
<@870575513763217440> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?