Skip to content

ng new --viewEncapsulation Native|None|ShadowDom generates invalid code #13742

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
thojo opened this issue Feb 22, 2019 · 2 comments · Fixed by #13740
Closed

ng new --viewEncapsulation Native|None|ShadowDom generates invalid code #13742

thojo opened this issue Feb 22, 2019 · 2 comments · Fixed by #13740
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@thojo
Copy link

thojo commented Feb 22, 2019

🐞 Bug report

Command (mark with an x)

- [x] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 7.3.2

Description

The fix for #13689 now generates a second comma between styleUrls and encapsulation. The comma behind styleUrls is now also present if the flag --viewEncapsulation is not set at all and styleUrls is the last property.

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],, // ❗ duplicate comma
  encapsulation: ViewEncapsulation.Native
})
export class AppComponent {
}
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'], // ❗ unnecessary comma
})
export class AppComponent {
}

🔬 Minimal Reproduction

  • ng new view-test --skipGit --skipInstall --viewEncapsulation None
  • ng new view-test --skipGit --skipInstall

🔥 Exception or Error

ERROR in src/app/app.component.ts(6,38): error TS1136: Property assignment expected.

🌍 Your Environment

Angular CLI: 7.3.3
Node: 10.15.1
OS: win32 x64
Angular: 7.2.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.3
@angular-devkit/build-angular     0.13.3
@angular-devkit/build-optimizer   0.13.3
@angular-devkit/build-webpack     0.13.3
@angular-devkit/core              7.3.3
@angular-devkit/schematics        7.3.3
@angular/cli                      7.3.3
@ngtools/webpack                  7.3.3
@schematics/angular               7.3.3
@schematics/update                0.13.3
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0
@alan-agius4
Copy link
Collaborator

Fixed by #13740

@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 Sep 9, 2019
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 severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants