Error with Nuxt v3.0.0-rc.9: Package import specifier "#build/app.config.mjs" is not defined in package
See original GitHub issueDescribe 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)
- Visit reproduction link
- run
npm run dev
- everything should work fine. - Uncomment the
<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: https://github.com/nuxt/framework/issues/7244
Reproduction
https://stackblitz.com/edit/nuxt-starter-sf9sq6?file=components/BaseButton.vue
System Info
System:
OS: Linux 5.0 undefined
CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.17.0 - /usr/local/bin/npm
npmPackages:
@histoire/plugin-nuxt: ^0.10.7 => 0.10.7
@histoire/plugin-vue: ^0.10.7 => 0.10.7
histoire: ^0.10.7 => 0.10.7
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:18 (3 by maintainers)
Top Results From Across the Web
Nuxt 3 package import specifier "#internal/nitro" is not defined
If you are using Nuxt and encounter this error, chances likely that this is not the correct solution. Please find another one).
Read more >Package import specifier "#build/app.config.mjs" is not defined ...
I have the issue with a .story.vue file too. It happens on RC-9 and RC-10. Error while collecting story ...
Read more >[nuxt] [request error] require is not defined in es module scope ...
How can I go about requiring or importing this CommonJS module (algosdk 1.18.1) with Nuxt3/Vite? Attempts using Require: const algosdk = require('algosdk') and ......
Read more >Commands and Deployment - Nuxt
Using in package.json · Development Environment · List of Commands · Webpack Config Inspection · Production Deployment · What's next?
Read more >nuxt/webpack-builder - NPM Package Overview - Socket.dev
Start using Socket to analyze @nuxt/webpack-builder and its 39 ... and defineNuxtConfig imports from nuxt (import from nuxt/config ) ...
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 Free
Top 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
The BaseButton.vue component has a
<NuxtLink>
inside which is commented out, if I uncomment the<NuxtLink>
, I still get the error.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?