angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Error message still is wrong

Open Gouvernathor opened this issue 1 year ago • 5 comments

Command

serve

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

As stated in the other issues, the error message indicates that there is an incompatibility with browser version constraints, mentioning a "target environment" and listing browser versions. But the actual reason (a bug in zone.js) has nothing to do with browser constraints. In case your goal is not to make devs lose many days trying to remove browser constraints that aren't there, this should be fixed.

Minimal Reproduction

import languageIds from '../assets/langages.json';
export {languageIds};
const translations: Readonly<Record<string, Readonly<Record<string, string>>>> = Object.fromEntries(await Promise.all(
    languageIds.map(async (languageId) => (
        [languageId, await import(`../assets/languages/${languageId}.json`)]
))));

With the required JSON files, followed by ng serve or ng build.

Exception or Error

X [ERROR] Top-level await is not available in the configured target environment ("chrome129.0", "edge129.0", "firefox115.0", "ios17.0", "node22.0.0", "safari17.0" + 5 overrides)

    src/configuration.ts:5:40:
      5 │ ...slations = Object.fromEntries(await Promise.all(languageIds.map(...
        ╵                                  ~~~~~

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 18.2.12
Node: 20.18.0
Package Manager: npm 10.9.0
OS: win32 x64

Angular: 18.2.12
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.12
@angular-devkit/build-angular   18.2.12
@angular-devkit/core            18.2.12
@angular-devkit/schematics      18.2.12
@schematics/angular             18.2.12
rxjs                            7.8.1
typescript                      5.5.4
zone.js                         0.14.10

Anything else relevant?

No response

Gouvernathor avatar Nov 20 '24 10:11 Gouvernathor

Hi @alan-agius4, I would like to deal with this issue is it possible? If there are already some indications on the possible resolution I could proceed by following them.

Thank you very much

aparzi avatar Jan 25 '25 10:01 aparzi

Reporting that the error message is still wrong a year later @alan-agius4

Gouvernathor avatar Oct 03 '25 20:10 Gouvernathor

@Gouvernathor, feel free to open a PR.

alan-agius4 avatar Oct 04 '25 08:10 alan-agius4

That's what @aparzi was asking for

Gouvernathor avatar Oct 04 '25 09:10 Gouvernathor

@Gouvernathor I'm currently working on some Angular Core migration issues, but I don't know if I'll be able to dedicate any time to this problem. If I can, I'll gladly do so.

aparzi avatar Oct 04 '25 09:10 aparzi