-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
cannot import from nuxt/app
(Package import specifier "#build/app.config.mjs" is not defined)
#14801
Comments
Same to me. yarn dev works but yarn generate throw an error. My package contains: "devDependencies": {
"@nuxt/image": "^0.7.1",
"@nuxtjs/tailwindcss": "^5.3.2",
"nuxt": "3.0.0-rc.9",
"vue-gtag-next": "^1.14.0"
},
"dependencies": {
"@splidejs/vue-splide": "^0.6.7"
} Error log:
|
+1 - removing vue dependency from package.json and then running the dev server works fine, however when building for production we get:
|
does it work if you set experimental.externalVue to false in nuxt.config ? |
@huang-julien just tried your suggestion but the same problem continuos. Thanks for the suggestion. |
same here. im using npm and upgrading from rc8 |
Please ensure you are not importing directly from |
Seeing the same on my end with rc9 |
+1 Is there a temporary solution in place? |
@danielroe This worked for me. thanks! |
I bumped my dependency and I am facing this issue with I get: The line in question is: |
nuxt/app
(Package import specifier "#build/app.config.mjs" is not defined)
same for me as @Lyokolux but with |
I fixed it by inlining nuxt as a dep |
@danielroe what do you mean ? should I change or where do I make the change? how did you fixed it @emaia |
No, your Nuxt config is the one place you should import anything from |
I see, @danielroe thanks for clarifying that. I changed it in one place but the problem persist. |
@iamdagy I updated my code in plugins folder. import {defineNuxtPlugin} from "#imports"; @danielroe My nuxt.config.ts was not changed and has |
@boboldehampsink how did you add Nuxt as a dependency? Thanks |
I'm talking about vitest config - see https://vitest.dev/config/#deps-inline |
@boboldehampsink I see, Im not using vitest. thanks for the info. |
@danielroe can I still import from cue from pages and components? I mean thinks like ref, watch and so on? I can't find any other import from Nuxt, Nuxt/app, or #app The plugins is for persist state:
|
Does anyone knows how to inline deps with vite such as vitest does to fix it ? I don't find it in their docs. |
I was indeed importing from Nuxt/app in another place ( the Pinia Store) after changing it to #imports everything works now. Thanks |
I'm confused, so Instead of importing from nuxt/app we have to import from "#imports".. well, it sounds strange, but okay... But if I do so, i get: Update: I wrote '#import' instead of '#imports'. Fixed it. |
@simllll Would you raise a new issue if you can reproduce this? This is what I see... |
Ah yes sorry, i figured it out already here: #14880 |
I'm still facing the same issue. replacing '#imports' w '#import' does not work either |
This should be resolved in the edge channel, or in the next RC. |
Still see this with Histoire |
Then please do raise an issue there with a reproduction. Feel free to tag me. |
This still occurs to me while running tests via Inlining deps as @boboldehampsink mentioned didn't do the trick for me. My Error still remains:
After tracking it further down, it seems like the error occurs only if |
Yes, this should work, assuming you are using nuxt/test-utils and not unit testing that component. (Follow https://github.com/nuxt/nuxt.js/issues/13077 for unit testing support.) |
I am experiencing the same issue. replacing nuxt/app with #imports removed the error, instead, caused this new error: |
@ChurikiTenna Would you open a new issue with a reproduction? |
I have a similar issue and have created an issue with reproduction over here: histoire-dev/histoire#430 |
That isn't a Nuxt issue but to do with the way histoire is loading nuxt composables outside the Nuxt environment. We're tracking improvements that third-party tools can take advantage of via: |
We also experienced this issue with histoire (v 0.12.4) and useCookie. Upgrading to v 0.15 fixed the issue, but caused some other problems, so we had to find another solution. Relied on an external package in the end, since we did not find a better solution |
Environment
Operating System: MacOS Ventura
Node Version: v16.13.0.
Nuxt Version: 3.0.0-rc.9
Nitro Version: 0.5.0
Package Manager: yarn@1.22.19
Builder: webpack ( I think)
User Config:
Runtime Modules:
"dependencies": {
"@formkit/i18n": "^1.0.0-beta.10",
"@pinia/nuxt": "^0.4.1",
"axios": "^0.27.2",
"pinia": "^2.0.21",
"pinia-plugin-persistedstate": "^2.1.1",
"postmark": "^3.0.1",
"swiper": "^8.3.1",
"vue3-marquee": "^3.0.7"
}
Build Modules:
"devDependencies": {
"@aceforth/nuxt-netlify": "^1.1.0",
"@formkit/nuxt": "^1.0.0-beta.11-0dd967c",
"@iconify-json/heroicons-solid": "^1.1.1",
"@nuxtjs/tailwindcss": "^5.3.2",
"@tailwindcss/typography": "^0.5.7",
"@vueuse/core": "^9.1.1",
"@vueuse/nuxt": "^9.1.1",
"netlify-cli": "^11.5.1",
"nuxt": "3.0.0-rc.9",
"unplugin-icons": "^0.14.5"
}
Reproduction
I upgrade with yarn upgrade and with yarn upgrade nuxt, then yarn upgrade --force, and then yarn upgrade --latest.
I upgraded to RC.9 and a few packages that didn't work I upgraded manually to the edge repository like formkit that needed yarn add @formkit/nuxt@next --dev .
I'will try to make a minimal reproduction, but as the project has many pages and components Im not sure if I have to recreate the whole project.
Describe the bug
When I do yarn build -> the site is completely broken it doesn't load any page.
When I do yarn dev -> the site works ok
When I do yarn check -> There is 1 error
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: