You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Description
When attempting to import .svg files in unit tests by configuring an esbuild-style loader under the test target in angular.json, the CLI rejects the configuration with a JSON‐schema validation error (“Property not allowed”). As a result, importing SVGs in specs fails with:
No loader is configured for ".svg" files
Important: with the normal build it works perfectly fine.
Expected Behavior:
The builderMode: "application" and accompanying loader map should be accepted by the test builder’s schema, enabling esbuild to inline or file‐emit .svg imports exactly as in the application build.
Specs importing SVGs should compile under the esbuild‐powered pipeline without further WebPack tweaks.
The CLI fails schema validation on angular.json with an error like:
Schema validation failed with the following errors:
Data path “/projects/phlu-webapp/architect/test/options” should NOT have additional properties(loader).
Tests continue to use the WebPack‐based Karma builder (which knows nothing about esbuild loaders), so importing an SVG in a spec throws:
Command
test
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Description
When attempting to import .svg files in unit tests by configuring an esbuild-style loader under the test target in angular.json, the CLI rejects the configuration with a JSON‐schema validation error (“Property not allowed”). As a result, importing SVGs in specs fails with:
No loader is configured for ".svg" files
Important: with the normal build it works perfectly fine.
Expected Behavior:
The builderMode: "application" and accompanying loader map should be accepted by the test builder’s schema, enabling esbuild to inline or file‐emit .svg imports exactly as in the application build.
Specs importing SVGs should compile under the esbuild‐powered pipeline without further WebPack tweaks.
Docs to the implementation example
Docs to the test build
Actual Behavior:
The CLI fails schema validation on angular.json with an error like:
Tests continue to use the WebPack‐based Karma builder (which knows nothing about esbuild loaders), so importing an SVG in a spec throws:
No loader is configured for ".svg" files
Minimal Reproduction
Component to load the svg
svg-loader.component.ts
svg-loader.component.html
Angular.json
Commands
ng test --watch=false --no-progress --browsers=ChromeHeadlessCI --code-coverage
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: