ng generate universal (after adding pwa) update main.ts incorrectly causing syntax error #13392
Labels
area: schematics/angular
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Milestone
Bug Report or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
node --version
node v11.0.0
npm --version
npm 6.4.1
ng --version
Angular CLI: 7.2.1
Node: 11.0.0
OS: darwin x64
Angular: 7.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Package Version
@angular-devkit/architect 0.12.1
@angular-devkit/build-angular 0.12.1
@angular-devkit/build-optimizer 0.12.1
@angular-devkit/build-webpack 0.12.1
@angular-devkit/core 7.2.1
@angular-devkit/schematics 7.2.1
@angular/cli 7.2.1
@angular/pwa 0.12.1
@ngtools/webpack 7.2.1
@schematics/angular 7.2.1
@schematics/update 0.12.1
rxjs 6.3.3
typescript 3.2.2
webpack 4.23.1
OS
macOS High Sierra
Repro steps
check out https://github.com/Jun711/angular-app-shell/tree/master
Note that when u check out the above repo on master branch, it already has pwa added using
ng add @angular/pwa
. (the issue might occur only when ng generate universal is done after ng add @angular/pwa but I am not sure if that is the case)on master branch, run
ng generate universal uni-app-shell --client-project angular-app-shell
The update was from
to
It just needs an extra closing curly brace.
I am not sure what source code to edit to fix that. If you could point me to it, I can do a pull request if necessary.
The log given by the failure when I ran
ng serve
Date: 2019-01-09T20:25:21.997Z
Hash: 9e6345c3e1fcb145c2b1
Time: 2420ms
chunk {main} main.js, main.js.map (main) 1.86 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 92.4 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.6 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 322 kB [initial] [rendered]
ERROR in src/main.ts(14,1): error TS1128: Declaration or statement expected.
ℹ 「wdm」: Failed to compile.
Desired functionality
to have main.ts updated without any syntax error
Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: