8000 optimization error when switching from 15.0.5 to 15.1.0 · Issue #24526 · angular/angular-cli · GitHub
[go: up one dir, main page]

Skip to content

optimization error when switching from 15.0.5 to 15.1.0 #24526

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
1 task done
jnizet opened this issue Jan 11, 2023 · 7 comments · Fixed by #24531
Closed
1 task done

optimization error when switching from 15.0.5 to 15.1.0 #24526

jnizet opened this issue Jan 11, 2023 · 7 comments · Fixed by #24531

Comments

@jnizet
Copy link
Contributor
jnizet commented Jan 11, 2023

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

15.0.5

Description

When switching from version 15.0.5 to version 15.1.0 of the CLI, the ng build command fails with the following error:

Error: Optimization error [main.4718ba8213dd7bf6.js]: SyntaxError: Unexpected token: punc (()

Minimal Reproduction

See jnizet/decouvertes-nature#521.

To reproduce locally:

  • clone the project
  • checkout to the branch renovate/angular-cli-monorepo
  • run yarn
  • run ng build

Exception or Error

Error: Optimization error [main.4718ba8213dd7bf6.js]: SyntaxError: Unexpected token: punc (()


### Your Environment

```text
Angular CLI: 15.1.0
Node: 16.15.0
Package Manager: yarn 1.22.19
OS: darwin x64

Angular: 15.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1501.0
@angular-devkit/build-angular   15.1.0
@angular-devkit/core            15.1.0
@angular-devkit/schematics      15.1.0
@angular/fire                   7.5.0
@schematics/angular             15.1.0
rxjs                            7.8.0
typescript                      4.8.4


### Anything else relevant?

_No response_
@atsjo
Copy link
atsjo commented Jan 11, 2023

same for me...

@leonelvsc
Copy link

Same here

@clydin
Copy link
Member
clydin commented Jan 11, 2023

This appears to be a bug in esbuild which is used within the optimization pipeline. A fix with esbuild will most likely be needed to resolve the issue.

@atsjo
Copy link
atsjo commented Jan 11, 2023

the newly released esbuild 0.16.17 fixes this. confirmed by overriding esbuild dependency via

  "resolutions": {
    "@angular-devkit/build-angular/esbuild": "^0.16.17"
  }

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 12, 2023
This release contains a fix for `SyntaxError: Unexpected token: punc (()`

Closes angular#24526
angular-robot bot pushed a commit that referenced this issue Jan 12, 2023
This release contains a fix for `SyntaxError: Unexpected token: punc (()`

Closes #24526
angular-robot bot pushed a commit that referenced this issue Jan 12, 2023
This release contains a fix for `SyntaxError: Unexpected token: punc (()`

Closes #24526

(cherry picked from commit b68467f)
@kwhjvdkamp
Copy link
kwhjvdkamp commented Jan 12, 2023

Thanks @anisaboud ! Unfortunately, no luck! See, #48722

@clydin
Copy link
Member
clydin commented Jan 12, 2023

For any projects encountering this issue, please update the Angular CLI to 15.1.1.

@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 Feb 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
0