Skip to content

Better error messages when switching from browser-esbuild to application builder #26260

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
hakimio opened this issue Nov 7, 2023 · 2 comments

Comments

@hakimio
Copy link

hakimio commented Nov 7, 2023

Command

build

Description

When trying to switch from browser-esbuild to application builder like the deprecation warning suggests, I get the following cryptic messages:

  • Data path "" must have required property 'browser'.: means main option was split to browser and server and you are supposed to add at least browser option:
"architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:application",
          "options": {
            "browser": "src/main.ts",
  • Data path "" must NOT have additional properties(main).: main was replaced by browser and server.
  • Data path "/polyfills" must be array.. "polyfills": "src/polyfills.ts" option should be replaced with "polyfills": ["zone.js"]

Describe the solution you'd like

Better error messages.

Describe alternatives you've considered

No response

@dgp1130
Copy link
Collaborator

dgp1130 commented Nov 8, 2023

Agreed the error message here is not great. Unfortunately, this one is generated from Architect which is too generic to really be more specific. It doesn't have the context to give more information here.

We have a more general issue tracking this here: #11479

For browser / browser-esbuild -> application specifically, we're working on a schematic to automatically perform this migration so users would never make this mistake in the first place.

@dgp1130 dgp1130 closed this as completed Nov 8, 2023
@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 Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants