auto import failing when using my module deployed on npm
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 275
- Forks
- 35
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 6
Description
Hi,
I've created a custom module that has a few composeables.
When I use the module installed via npmjs I get errors of undefined on pretty much all nuxt utilities (useRuntimeConfig, defineNuxtPlugin etc).
When I use the module locally with link it works fine.
Doesn't seem to be a build/package problem; I get no errors if I use explicit imports in the module composeables
Using:
- node v22.19.0
- nuxt 4.1 (same happens on 3.17)
- pnpm (same problem with yarn)
Any idea why this might happen, how to troubleshoot ? I'll gladly submit a fix, just somewhat new to nuxt modules and need a bit of guidance on where to start ...
Thank you,
Rares
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the module installed from npm, then compare it with the locally linked version using Nuxt 4.1 and 3.17. Start by checking the composeables that use useRuntimeConfig and defineNuxtPlugin, and compare them with the explicit-import behavior; done means those Nuxt utilities work without explicit imports in the published package.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100