-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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 start nuxt: Package subpath './nuxt' is not defined by "exports" #14602
Comments
Impossible to say exactly without seeing your code, but you likely need to add a subpath exports like: "exports": {
// ...
"./nuxt": "./dist/nuxt.mjs"
}, See more at https://nodejs.org/api/packages.html#packages_subpath_exports. |
Thanks for your answer. As for the exports I just used the "main" and direct it to the built module files:
My module.ts looks like this:
And then runtime contains just plugins and components using primevue as plain vue/nuxt code. If you still need more info to investigate, please let me know then I'll try to setup a minimal repro. |
Yes, a reproduction would be helpful, thanks. |
Added a repro on my personal github in the following repository: https://github.com/jclaessens97/nuxt-module-repro |
Yes, if you are importing from But you don't need it. Just remove the - modules: ['@proj/ui/nuxt'],
+ modules: ['@proj/ui'], |
In the same repro I tried removing the
It's not only the primevue plugin. I have the same with all plugins. It always throws on the first plugin I try to add (bottom to top in the |
Great! (in response to a message that read: "And now it seems to be working fine 👌") |
Yeah, my bad, I removed it since I was a bit too quick 😅 I managed to get it working, but there is still something off. For the repro to work, I have to run I'm still investigating though because in my real app it's still not working. |
I setup a nuxt module following the (limited) docs and the module starter template.
The playground works, but whenever I want to build and use it in my main nuxt application (using pnpm and
file:../ui
), I get following error output:npx nuxi info
output:I configured the module as
proj/ui/nuxt
and I'm sure I build it first using theprepack
command.Any pointers on what it could be?
(I replaced the real namespaced project name with
proj
)The text was updated successfully, but these errors were encountered: