Skip to content

The above dynamic import cannot be analyzed by Vite. #59764

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

Closed
mmonteroewp opened this issue Jan 28, 2025 · 2 comments
Closed

The above dynamic import cannot be analyzed by Vite. #59764

mmonteroewp opened this issue Jan 28, 2025 · 2 comments
Labels
area: core Issues related to the framework runtime bug core: hot module replacement (HMR)
Milestone

Comments

@mmonteroewp
Copy link

Which @angular/* package(s) are the source of the bug?

compiler-cli

Is this a regression?

Yes

Description

I upgraded to Angular 19.1 and activated HMR.
I am using the @angular/build:dev-server builder.
When I run "ng server" and as soon as I open my app, I get several warnings on the terminal console regarding Vite not able to analyze Dynamic imports.
I don't have dynamic imports, except for Lazy Loading components.
The warnings seem to be related to Lazy Loading and they disappear if I turn HMR off.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

12:46:39 PM [vite] (client) warning: 
/media/mario/Lin-Dev/repos/SmartFactory/EWP.SF.FrontTemplate/.angular/vite-root/SmartFactory/chunk-PVDRENNO.js
395|  (() => {
396|    function TwostepComponent_HmrLoad(t) {
397|      import(new URL("./@ng/component?c=src%2Fapp%2Fcore%2Fauth%2Ftwostep%2Ftwostep.component.ts%40TwostepComponent&t=" + encodeURIComponent(t), import.meta.url).href).then((m) => m.default && i02.\u0275\u0275replaceMetadata(TwostepComponent, m.default, [i02, i12, i22, i32], [NgOtpInputComponent2, TranslateModule2, ReactiveFormsModule2, NgOtpInputModule2, RouterLink, SetupDetailComponent]));
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
398|    }
399|    (typeof ngDevMode === "undefined" || ngDevMode) && TwostepComponent_HmrLoad(Date.now());
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: /media/mario/Lin-Dev/repos/SmartFactory/EWP.SF.FrontTemplate/.angular/vite-root/SmartFactory/chunk-PVDRENNO.js

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.1.4
Node: 23.6.0 (Unsupported)
Package Manager: pnpm 9.15.4
OS: linux x64

Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1901.4 (cli-only)
@angular-devkit/core         19.1.4 (cli-only)
@angular-devkit/schematics   19.1.4 (cli-only)
@angular/build               19.1.4
@angular/cdk                 19.1.1
@angular/cli                 19.1.4
@angular/material            19.1.1
@schematics/angular          19.1.4 (cli-only)
rxjs                         7.8.1
typescript                   5.7.3

Anything else?

No response

@alxhub alxhub added area: core Issues related to the framework runtime bug core: hot module replacement (HMR) labels Jan 28, 2025
@ngbot ngbot bot modified the milestone: needsTriage Jan 28, 2025
@clydin
Copy link
Member

clydin commented Jan 28, 2025

Duplicate of angular/angular-cli#29470

@clydin clydin marked this as a duplicate of angular/angular-cli#29470 Jan 28, 2025
@clydin clydin closed this as completed Jan 28, 2025
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime bug core: hot module replacement (HMR)
Projects
None yet
Development

No branches or pull requests

3 participants