-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Error with Nuxt v3.0.0-rc.9: Package import specifier "#build/app.config.mjs" is not defined in package #286
Comments
I have the issue with a
|
This should be resolved in the edge channel, or in the next RC. Let me know if not. |
Hmm no, still the same error, tested on Stackblitz (but I am not able to get the latest edge release, it still states it is rc.9) And locally with edge release, still same error message with reference to rc.11 Error while collecting story /home/gmavors/dev/nue/stories/BaseIcon.story.vue:
TypeError [ERR_PACKAGE_IMPORT_NOT_DEFINED]: Package import specifier "#build/app.config.mjs" is not defined in package /home/gmavors/dev/nue/node_modules/.pnpm/nuxt3@3.0.0-rc.11-27727864.720da64_itqs5654cmlnjraw6gjzqacppi/node_modules/nuxt3/package.json imported from /home/gmavors/dev/nue/node_modules/.pnpm/nuxt3@3.0.0-rc.11-27727864.720da64_itqs5654cmlnjraw6gjzqacppi/node_modules/nuxt3/dist/app/config.mjs
at new NodeError (node:internal/errors:372:5)
at throwImportNotDefined (node:internal/modules/esm/resolve:422:9)
at packageImportsResolve (node:internal/modules/esm/resolve:791:3)
at moduleResolve (node:internal/modules/esm/resolve:944:16)
at defaultResolve (node:internal/modules/esm/resolve:1166:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:536:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:250:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:40)
at link (node:internal/modules/esm/module_job:78:36) |
You should be able to see it working in the stackblitz I linked. |
The BaseButton.vue component has a |
I have the problem too. In my case (current Nuxt 3 RC11) the error occurs when the component has a Pinia store included or I use |
Same issue here: sidebase/sidebase#51 |
If you are experiencing this error (with 'import specifier' error message), would you provide a reproduction? I cannot reproduce it. As for the issue with
|
Regarding the missing props, you were right. But when I use rc.8, I can use
So this should most likely be fixed in the |
The change is that now, in nuxt core, We are exploring ideas in Nuxt to make this easier to integrate with tools like Histoire, but until then you'll need to stub It's not a bug with Histoire; there are quite a lot of Nuxt core composables or components that depend on a broader Nuxt context. But possibly we could provide some built-in stubs in histoire - what do you think @Akryum? |
I'm still getting this error with Nuxt 3.0.0-rc.11 and Histoire 0.11.3 :(
Seems like something the Nuxt plug-in ought to take care of? |
@tobiashm A reproduction would be appreciated. |
@danielroe I will try to isolate the issue. It appears that about 1/5 of our stories are not affected by this, but I can't see what's different about the components in the ones that seems to work. |
Here some content: It fails on 2 stories out of 50 for me. Both stories uses a common Vue Component.
|
Yes, |
It works with Nuxt RC.8 and Histoire 0.10.7. They are my current working versions. |
As stated in the initial post of this issue, something changed in Nuxt RC.9 because stories with NuxtLink in it were working in Histoire with Nuxt RC.8. I've now again an issue when using the Nuxt Icon Module since it also relies on the nuxt context, it is not working with Histoire and I again get these errors "package import specifier....". Also I am not able to go back to RC.8 because the module needs atleast RC.9.
So until this is not resolved, we would need create workarounds for all components which rely directly on the nuxt context or use components which rely on it? |
Same issue for me when importing a component using the |
Why is this closed if it is still happening? |
Describe the bug
When using Histoire with Nuxt v3.0.0-rc.9 there seems to be an issue with the built-in components like
<NuxtLink>
. (Nuxt v3.0.0-rc.8 works fine)npm run dev
- everything should work fine.<NuxtLink>
in theBaseButton.vue
component and reload webcontainer.Error occurs:
Error while collecting story /home/projects/nuxt-starter-sf9sq6/stories/BaseButton.story.vue:
TypeError [ERR_PACKAGE_IMPORT_NOT_DEFINED]: Package import specifier "#build/app.config.mjs" is not defined in package /home/projects/nuxt-starter-sf9sq6/node_modules/nuxt/package.json imported from /home/projects/nuxt-starter-sf9sq6/node_modules/nuxt/dist/app/config.mjs
There is also an issue in the Nuxt repo regarding this issue: nuxt/nuxt#14801
Reproduction
https://stackblitz.com/edit/nuxt-starter-sf9sq6?file=components/BaseButton.vue
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: