Skip to content
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

Error using experimentalPlatform neutral with provideAnimationsAsync #28941

Open
1 task
fiste788 opened this issue Nov 22, 2024 · 0 comments · May be fixed by #28953
Open
1 task

Error using experimentalPlatform neutral with provideAnimationsAsync #28941

fiste788 opened this issue Nov 22, 2024 · 0 comments · May be fixed by #28953
Assignees

Comments

@fiste788
Copy link

Command

build

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

When using new experimentalplatform neutral with provideAnimationsAsync() in app.config.ts i have on build

Minimal Reproduction

I have a repro here https://github.com/fiste788/tmp-animations-async
Cloning, running npm install and npm run build will give you the error.
If you change to provideAnimations() without async at line
https://github.com/fiste788/tmp-animations-async/blob/562c37a48c9f0c0a52f6ffacbdc5faec25dfe0d5/src/app/app.config.ts#L8
to make the build work.

Exception or Error

TypeError: Class extends value undefined is not a constructor or null
    at file:///D:/Projects/Personal/Fantamanajer/test19v2/.angular/prerender-root/a3011629-d592-49a7-91c1-a8b6d1656845/chunk-GFZLE2P2.mjs:34:17047
    at file:///D:/Projects/Personal/Fantamanajer/test19v2/.angular/prerender-root/a3011629-d592-49a7-91c1-a8b6d1656845/chunk-GFZLE2P2.mjs:34:17240
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:429:15)
    at async extractRoutes (D:\Projects\Personal\Fantamanajer\test19v2\node_modules\@angular\build\src\utils\server-rendering\routes-extractor-worker.js:23:83)
    at async D:\Projects\Personal\Fantamanajer\test19v2\node_modules\piscina\dist\worker.js:144:26

Your Environment

Angular CLI: 19.0.1
Node: 18.20.3
Package Manager: bun <error>
OS: linux x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.1
@angular-devkit/build-angular   19.0.1
@angular-devkit/core            19.0.1
@angular-devkit/schematics      19.0.1
@angular/cli                    19.0.1
@angular/ssr                    19.0.1
@schematics/angular             19.0.1
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

Anything else relevant?

No response

@alan-agius4 alan-agius4 self-assigned this Nov 24, 2024
@alan-agius4 alan-agius4 added needs: investigation Requires some digging to determine if action is needed angular/build:application area: @angular/build type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken and removed needs: investigation Requires some digging to determine if action is needed labels Nov 24, 2024
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 25, 2024
… code reordering

Resolved an issue where the use of `esbuild`'s `inject` feature caused incorrect reordering of class structures during bundling. This reordering affected extended classes, as illustrated below:

```js
class e extends Ur {
  constructor(n, r, i) {
    super(n, r, i);
  }
  ngOnDestroy() {
    this.flush();
  }
  static ɵfac = function (r) {
    return new (r || e)(pe(Xe), pe(Ti), pe(Di));
  };
  static ɵprov = oe({ token: e, factory: e.ɵfac });
}

var Ur = class {
  // Class properties and methods omitted for brevity
};
```

By reducing the reliance on `inject`, we ensure that the ordering of class properties and methods remains consistent, preserving the expected behavior.

Closes angular#28941
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 25, 2024
… code reordering

Resolved an issue where the use of `esbuild`'s `inject` feature caused incorrect reordering of class structures during bundling. This reordering affected extended classes, as illustrated below:

```js
class e extends Ur {
  constructor(n, r, i) {
    super(n, r, i);
  }
  ngOnDestroy() {
    this.flush();
  }
  static ɵfac = function (r) {
    return new (r || e)(pe(Xe), pe(Ti), pe(Di));
  };
  static ɵprov = oe({ token: e, factory: e.ɵfac });
}

var Ur = class {
  // Class properties and methods omitted for brevity
};
```

By reducing the reliance on `inject`, we ensure that the ordering of class properties and methods remains consistent, preserving the expected behavior.

Closes angular#28941
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Nov 25, 2024
… code reordering

Resolved an issue where the use of `esbuild`'s `inject` feature caused incorrect reordering of class structures during bundling. This reordering affected extended classes, as illustrated below:

```js
class e extends Ur {
  constructor(n, r, i) {
    super(n, r, i);
  }
  ngOnDestroy() {
    this.flush();
  }
  static ɵfac = function (r) {
    return new (r || e)(pe(Xe), pe(Ti), pe(Di));
  };
  static ɵprov = oe({ token: e, factory: e.ɵfac });
}

var Ur = class {
  // Class properties and methods omitted for brevity
};
```

By reducing the reliance on `inject`, we ensure that the ordering of class properties and methods remains consistent, preserving the expected behavior.

Closes angular#28941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants