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

Angular CLI SSR Configuration removes trailing comma in AppConfig, resulting in Syntax Errors #26911

Closed
1 task
JonasDev17 opened this issue Jan 22, 2024 · 1 comment · Fixed by #26929
Closed
1 task
Assignees
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix

Comments

@JonasDev17
Copy link

JonasDev17 commented Jan 22, 2024

Command

add

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

Upon running ng add @angular/ssr the following happened:

        provideHotToastConfig({
            position: "bottom-right",
        })provideClientHydration(),
        

provideClientHydration was not placed on a new line and the trailing comma was removed, resulting in a syntax error.

image

Minimal Reproduction

run:

ng add @angular/ssr

Exception or Error

Syntax Error

Your Environment

Angular CLI: 17.1.0
Node: 18.14.2
Package Manager: pnpm 8.6.11
OS: win32 x64

Angular: 17.1.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, material-luxon-adapter, platform-browser
... platform-browser-dynamic, platform-server, router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.3
@angular-devkit/build-angular   17.1.0
@angular-devkit/core            17.0.3
@angular-devkit/schematics      17.0.3
@schematics/angular             17.1.0
rxjs                            7.8.0
typescript                      5.3.3
zone.js                         0.14.3

Anything else relevant?

No response

@JonasDev17 JonasDev17 changed the title Angular CLI SSR Configuration Fails to Consider Trailing Comma in AppConfig, Resulting in Syntax Errors Angular CLI SSR Configuration removes trailing comma in AppConfig, resulting in Syntax Errors Jan 22, 2024
@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely area: @schematics/angular severity3: broken labels Jan 22, 2024
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 23, 2024
… to app config

This fixes an issue which caused the new provider to be added in the position of the traling comma. With this change the trailing comma is retained.

Closes angular#26911
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 23, 2024
… to app config

This fixes an issue which caused the new provider to be added in the position of the trailing comma. With this change the trailing comma is retained.

Closes angular#26911
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 23, 2024
… to app config

This fixes an issue which caused the new provider to be added in the position of the trailing comma. With this change the trailing comma is retained.

Closes angular#26911
@alan-agius4 alan-agius4 self-assigned this Jan 23, 2024
alan-agius4 added a commit that referenced this issue Jan 23, 2024
… to app config

This fixes an issue which caused the new provider to be added in the position of the trailing comma. With this change the trailing comma is retained.

Closes #26911
alan-agius4 added a commit that referenced this issue Jan 23, 2024
… to app config

This fixes an issue which caused the new provider to be added in the position of the trailing comma. With this change the trailing comma is retained.

Closes #26911

(cherry picked from commit 90363dd)
@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 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
2 participants