Loader declared in angular.json as file not working on development but works in production #30041
Labels
area: @angular/build
devkit/build-angular:dev-server
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
In Angular 17, I utilized a loader to process
.glb
files as assets. This setup functioned smoothly in both development and production environments, with the files being correctly copied to the designated asset directory during production builds. Iacrchitect.build.options
Upon upgrading to Angular 19, the loader configuration ceased to work in development mode, although it remains functional in production. In production, the application operates without issues, and the
.glb
files are successfully transferred to the asset directory.The file is imported using the following statement:
However, in development mode, I encounter a console warning:
Additionally, the browser displays the following error:
As a consequence, the application crashes, rendering the development environment unusable.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
The code functions flawlessly in Angular 17 in both production and development environments.
However, after upgrading to Angular 19, the application fails to load
.glb
files in development mode, causing it to crash. In contrast, it operates as expected in production.Since the error message displayed is:
This suggests there may be an issue with the development server's implementation with vite for loading files in development mode.
The GLB files I use are around 100kb and are in binary format if this adds some useful info
The text was updated successfully, but these errors were encountered: