Skip to content
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

fix(kit): avoid falling back to normalized path for loadNuxtModuleInstance #27507

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jun 10, 2024

Discovered while investigating #27479

When installing nuxt modules, we use kit.resolvePath utility first to resolve aliases, etc.

If they cannot be resolved for any reason (this way happening in unit tests silently), the util returns the normalized value (which is ${cwd}/path).

Returned value can be something like /source/to/nuxt/@nuxt/telemetry which is obviously invalid and was being passed to the import() which was obviously always failing even when the module is a valid ESM module and then fallback to jiti (via kit.requireModule)

Jiti's ESM resolver (bundled mlly) was somehow (yet i don't know how) fixing this situation but with latest bundled ESM resolve algorithm, it won't be effective and revealed this..

Copy link

stackblitz bot commented Jun 10, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@pi0 pi0 requested a review from danielroe June 10, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants