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
HI,
Using the angular-architects/native-federation library and initializing with the command ng g @angular-architects/native-federation:init --type host the microfrontend will change the angular.json file by adding the esbuild configuration in architect. The esbuild configuration pre-configured the builder with the angular-devkit/build-angular:application option. If I run ng serve with this configuration the microfrontend works, but unfortunately I would need the browser-esbuild option and this is where the problem arises.
So by configuring angular-devkit/build-angular:browser-esbuild and changing the key from options.browser to options.main and then starting ng serve I get the error:
Error: Schema validation failed with the following errors:
Data path "" must have required property 'browser'.
Changing again from options.main to options.browser (not noticing that it warns you by saying: the browser property is not allowed.) and running ng serve again gives me:
Error: Schema validation failed with the following errors:
Data path "" must have required property 'main'.
Another test I performed is deleting the options.main/options.browser key and running ng serve again gives me the error:
Error: Schema validation failed with the following errors:
Data path "" must have required property 'main'.
Even initializing the microfrontend with --type remote gives the same problem
Minimal Reproduction
reproducing this error is simple:
make a new app
install @angular-architects/native-federation library (my version is 18.2.2)
initialize the microfrontend with ng g @angular-architects/native-federation:init --type host
change in angular.json file architect.esbuild.builder: "@angular-devkit/build-angular:browser-esbuild"
change from options.browser to options.main
ng serve
Exception or Error
Error: Schema validation failed with the following errors:
Data path "" must have required property 'browser'.
elio1fiore
changed the title
Use angular federation with build configuration: "@angular-devkit/build-angular:browser-esbuild"
Use angular federation with builder configuration: "@angular-devkit/build-angular:browser-esbuild"
Nov 11, 2024
elio1fiore
changed the title
Use angular federation with builder configuration: "@angular-devkit/build-angular:browser-esbuild"
Use angular native federation with builder configuration: "@angular-devkit/build-angular:browser-esbuild"
Nov 11, 2024
The browser-esbuild builder is intended solely as a compatibility bridge for migrating from the browser builder. Its only behavioral difference from application is that it transforms the browser builder options into application options.
Can you provide additional details on your project's use cases for browser-esbuild?
If we look in the projects folder of this library, we find the demo project configured with the :browser settings. Indeed, if I do NOT initialize the project with the command ng g @angular-architects/native-federation:init and by setting :browser, the project compiles and is exposed on localhost.
Currently, if I create MFEs with the ng g @angular-architects/native-federation:init command, the library no longer works. It definitely introduces an additional layer of complexity that I am trying to understand.
Command
serve
Is this a regression?
The previous version in which this bug was not present was
No response
Description
HI,
Using the angular-architects/native-federation library and initializing with the command ng g @angular-architects/native-federation:init --type host the microfrontend will change the angular.json file by adding the esbuild configuration in architect. The esbuild configuration pre-configured the builder with the angular-devkit/build-angular:application option. If I run ng serve with this configuration the microfrontend works, but unfortunately I would need the browser-esbuild option and this is where the problem arises.
So by configuring angular-devkit/build-angular:browser-esbuild and changing the key from options.browser to options.main and then starting ng serve I get the error:
Error: Schema validation failed with the following errors:
Data path "" must have required property 'browser'.
Changing again from options.main to options.browser (not noticing that it warns you by saying: the browser property is not allowed.) and running ng serve again gives me:
Error: Schema validation failed with the following errors:
Data path "" must have required property 'main'.
Another test I performed is deleting the options.main/options.browser key and running ng serve again gives me the error:
Error: Schema validation failed with the following errors:
Data path "" must have required property 'main'.
Even initializing the microfrontend with --type remote gives the same problem
Minimal Reproduction
reproducing this error is simple:
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: