-
Notifications
You must be signed in to change notification settings - Fork 12k
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
@angular-devkit/build-angular:dev-server | transforms js file loaded via assets-configuration #29310
Comments
Can you please check if this is still a problem in 19.1.0 which is currently in prerelease?
If the problem persists can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via |
yes, problem still occurs with version 19.1. import {
createHotContext as __vite__createHotContext }
...
from "/@vite/client";import.meta.hot = __vite__createHotContext( ...
....
from "/@vite/client" const __vite__id =
.... is there any possible setting that would cause this issue? |
This issue may be related to how these files are being utilized. Unfortunately, without a minimal runnable reproducible, further investigation isn't possible. |
Update In case you need a repro repo, let me know |
A reproduction would certainly speed up our investigation. |
Reproduction Repo: https://github.com/basti-n/angular-esbuild-dyn/tree/angular-cli-dev-server-issue Repro Step
|
Hi @basti-n, thanks for the reproduction. I had a look and it seems that the issue is no reproducible with 19.1. (
|
Closing as per above. |
Command
serve
Is this a regression?
The previous version in which this bug was not present was
17.3.11
Description
Background:
I dynamically load prebuild webcomponents (separate project / pkg using @angular/elements) in an Angular 19 Application.
These webcomponents are defined in assets-Configuration pointing to the respective package in node_modules.
Problem
When locally starting the Angular 19 Application (
build-angular:dev-server
), these dynamically loaded javascript assets are being transformed (by Vite I suppose) and hence an error occurs:ℹ All non Dev-Server related cases work flawlessly.
ℹ With Angular 17 the problem did not occur
The transformation, among other things, adds import statements (for some of the applications chunks).
serve config
and here the asset config from the build options.
In node_modules/@demo-wc/some-webcomponent contains the js-file.
Is this some regression, or is there any way to disable the transformation to the js files in node_modules when locally served via dev-server?
Minimal Reproduction
serve config
npm start script
Program runs fine until js-File from node_modules is dynamically loaded.
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: