Skip to content

Vite warning when loading ESM with loadRemote from @module-federation/enhanced/runtime #3250

@sk-pub

Description

@sk-pub

Describe the bug

Steps to reproduce:

  1. Generate a new Angular 18 app with ng new
  2. Use loadRemote from @module-federation/enhanced/runtime
  3. Start dev server and open localhost:4200
  4. Observe the following message in terminal:
[vite] warning: 
.../.angular/cache/18.2.12/angular-module-federation-esm-warning/vite/deps/@module-federation_enhanced_runtime.js
2134|                import(
2135|                  /* webpackIgnore: true */
2136|                  entry
   |                  ^^^^^
2137|                ).then(resolve).catch(reject);
2138|              } else {
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
  Plugin: vite:import-analysis
  File: .../.angular/cache/18.2.12/angular-module-federation-esm-warning/vite/deps/@module-federation_enhanced_runtime.js?v=c3d1dba7

Reproduction

I'll create a PR with a fix.

Reproduction

https://github.com/sk-pub/angular-module-federation-esm-warning

Used Package Manager

npm

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (24) x64 AMD Ryzen 9 7900X 12-Core Processor
    Memory: 13.57 GB / 31.15 GB
  Binaries:
    Node: 18.20.5 - ~\AppData\Local\Volta\tools\image\node\18.20.5\node.EXE
    npm: 10.8.2 - ~\AppData\Local\Volta\tools\image\node\18.20.5\npm.CMD
    pnpm: 8.11.0 - C:\Program Files\Volta\pnpm.EXE
    bun: 1.1.34 - ~\AppData\Local\Volta\bin\bun.EXE
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions