Package import specifier "#build/nuxt.config.mjs" is not defined in package
Hey. I'm getting this error when using a specific package, but the error is not pointing to that package specifically, but I'm guessing a dependency of that package. Is there something I can do to resolve this issue?
7 Replies
Hi @ægteemil. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, this issue appears to be related to a recent update in Nuxt 3.15.x. The error you're encountering is likely due to a problem with resolving imports in the new version of Nuxt.
Here are a few potential solutions you can try:
1. Update to the latest version of Nuxt:
Make sure you're using the latest version of Nuxt, as this issue might have been resolved in a recent patch. You can update by running:
or if you're using pnpm:
2. Clear the cache:
As suggested in this GitHub issue comment, you can try removing the Vite cache:
3. Configure Vite SSR:
As mentioned in this GitHub comment, you can try configuring
vite.ssr.noExternal
in your nuxt.config.ts
:
Replace 'package-name-causing-issue' with the name of the package you suspect is causing the problem.
4. Disable app manifest:
As a workaround, you can try disabling the app manifest in your nuxt.config.ts
:
If none of these solutions work, you may need to wait for a fix in the next Nuxt patch release. In the meantime, you could consider temporarily downgrading to a previous version of Nuxt where this issue didn't occur.
If the problem persists, it would be helpful to create a minimal reproduction of the issue and report it on the Nuxt GitHub repository.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@230357473389838336> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@ægteemil any luck figuring this issue out? running into the exact same issue.
nope, no clue. do you know which package you're using that's causing this?
not sure. the only modules I have loaded are nuxt ui and nuxt ui pro, though it’s kind of hard to tell if they are the cause, because I can’t really temporarily remove them.
i figured out which package caused it, or at least i think i did. was this one
https://heyapi.dev/openapi-ts/clients/nuxt
still have no clue why though
OpenAPI TypeScript
🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, valida...
huh... I use that too. ok, maybe I will rollback the version I'm pulling in and see if I can find one that worked, as I definitely had a functional version of the new openapi-ts nuxt client after the initial release...