{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/16704","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/16704/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/16704/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/16704/events","html_url":"https://github.com/Microsoft/vscode/issues/16704","id":193863223,"number":16704,"title":"Typescript Source formatting breaks @component structure in typescript and module fails to load","user":{"login":"hlesesne","id":117593,"avatar_url":"https://avatars.githubusercontent.com/u/117593?v=3","gravatar_id":"","url":"https://api.github.com/users/hlesesne","html_url":"https://github.com/hlesesne","followers_url":"https://api.github.com/users/hlesesne/followers","following_url":"https://api.github.com/users/hlesesne/following{/other_user}","gists_url":"https://api.github.com/users/hlesesne/gists{/gist_id}","starred_url":"https://api.github.com/users/hlesesne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlesesne/subscriptions","organizations_url":"https://api.github.com/users/hlesesne/orgs","repos_url":"https://api.github.com/users/hlesesne/repos","events_url":"https://api.github.com/users/hlesesne/events{/privacy}","received_events_url":"https://api.github.com/users/hlesesne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-06T19:31:53Z","updated_at":"2016-12-06T19:31:53Z","closed_at":null,"body":"- VSCode Version: 1.7.2\r\n- OS Version: LSB Version:\tcore-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch\r\nDistributor ID:\tUbuntu\r\nDescription:\tUbuntu 16.04.1 LTS\r\nRelease:\t16.04\r\nCodename:\txenial\r\n\r\nSteps to Reproduce:\r\n\r\n1. Assuming that in vscode, user settings, \"editor.formatOnSave\": true \r\n2. from terminal run > ng new my-app\r\n3. cd myapp\r\n4. ng serve\r\n5. open browser to localhost:4200 and you should see app works!\r\n6. ctrl-c to stop\r\n7. from terminal run > ng generate component my-component\r\n8. from terminal run > code .\r\n9. in vscode edit src/app/app.component.html adding <app-my-component></app-my-component> to the end of the html - ctrl-s to save\r\n10: from terminal run > ng serve\r\n11: refresh browser on localhost:4200 and you should see app works! and my-component works!\r\n12: in vscode edit src/app/my-component/my-component.component.ts, adding just a line to the bottom of the file and save with ctrl-s.\r\n\r\nNotice that the @component line has flattened the json from this:\r\n\r\n@Component({\r\n  selector: 'app-my-component',\r\n  templateUrl: './my-component.component.html',\r\n  styleUrls: ['./my-component.component.css']\r\n})\r\n\r\nto this:\r\n\r\n@Component({selector: 'app-my-component', templateUrl: './my-component.component.html', styleUrls: ['./my-component.component.css']})\r\n\r\n\r\n13: let webpack rebuild and refresh your browser on localhost:4200 and notice the following error in the console: Uncaught Error: Cannot find module \".\"(…)\r\nand the page never loads...\r\n\r\nI believe the problem is with the way the @component structure is flattened and then typescript can't process it for some reason, or does so incorrectly. If this is a tsc bug, I'd be happy to open something there instead.\r\n\r\nThanks for any help or guidance. For now, I am just turning off format on save and won't autoformat my typescript components for the time being.\r\n\r\nHonestly, if there were a way to keep ts formatting from combining the javascript object onto one line, I'd prefer it for readability. I'm assuming that it does the flattening because it is being passed to the @component method, but it is hard to see when long on the line like that.\r\n\r\nIt may also be that some extension is doing this, but I've disable beautify and any other installed extension that I could find that I suspect could cause this.\r\n\r\nBest regards,\r\n\r\nHal\r\n"}}
{"actor":{"display_login":"hlesesne"}}