Skip to content

ERR_MODULE_NOT_FOUND when inlining some modules #2308

@huang-julien

Description

@huang-julien

Environment


  • Operating System: Windows_NT
  • Node Version: v20.10.0
  • Nuxt Version: -
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.3
  • Package Manager: pnpm@8.14.1
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/unjs-nitro-starter-mhus1e?file=module%2Fmod.ts,module%2Fruntime%2Fplugin.ts,nitro.config.ts&title=Nitro%20Starter

Describe the bug

There's currently an issue (again sorry 🙏) with applicationinsights node.

We have a different issue on stackblitz and windows.

On windows we have
315223782-3fba0b2a-3488-4761-bf25-8c048a30cf0e

while on stackblitz the module is not found.

The only way to fix it seems to be to force the resolution of mlly to 1.4.0.

I think it's probably due the strip comment feature for mlly hasEsmSyntax and hasCjsSyntax is behind an experimental feature flag not enabled by default.

Additional context

The issue with windows is that the absolute paths generated in .nitro/dev/index.mjs are generated without file:// for applicationinsights imports.
image

After manually adding them back
image

We have another issue which is the stackblitz one.

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions