{"action":"created","issue":{"url":"https://api.github.com/repos/angular/material2/issues/189","repository_url":"https://api.github.com/repos/angular/material2","labels_url":"https://api.github.com/repos/angular/material2/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/angular/material2/issues/189/comments","events_url":"https://api.github.com/repos/angular/material2/issues/189/events","html_url":"https://github.com/angular/material2/issues/189","id":141526408,"number":189,"title":"require in sidenav's compiled module is pulling in .ts files","user":{"login":"aberenyi","id":1775664,"avatar_url":"https://avatars.githubusercontent.com/u/1775664?v=3","gravatar_id":"","url":"https://api.github.com/users/aberenyi","html_url":"https://github.com/aberenyi","followers_url":"https://api.github.com/users/aberenyi/followers","following_url":"https://api.github.com/users/aberenyi/following{/other_user}","gists_url":"https://api.github.com/users/aberenyi/gists{/gist_id}","starred_url":"https://api.github.com/users/aberenyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aberenyi/subscriptions","organizations_url":"https://api.github.com/users/aberenyi/orgs","repos_url":"https://api.github.com/users/aberenyi/repos","events_url":"https://api.github.com/users/aberenyi/events{/privacy}","received_events_url":"https://api.github.com/users/aberenyi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/material2/labels/P2:%20required","name":"P2: required","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"jelbourn","id":838736,"avatar_url":"https://avatars.githubusercontent.com/u/838736?v=3","gravatar_id":"","url":"https://api.github.com/users/jelbourn","html_url":"https://github.com/jelbourn","followers_url":"https://api.github.com/users/jelbourn/followers","following_url":"https://api.github.com/users/jelbourn/following{/other_user}","gists_url":"https://api.github.com/users/jelbourn/gists{/gist_id}","starred_url":"https://api.github.com/users/jelbourn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelbourn/subscriptions","organizations_url":"https://api.github.com/users/jelbourn/orgs","repos_url":"https://api.github.com/users/jelbourn/repos","events_url":"https://api.github.com/users/jelbourn/events{/privacy}","received_events_url":"https://api.github.com/users/jelbourn/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/material2/milestones/3","html_url":"https://github.com/angular/material2/milestones/alpha.2","labels_url":"https://api.github.com/repos/angular/material2/milestones/3/labels","id":1605843,"number":3,"title":"alpha.2","description":null,"creator":{"login":"jelbourn","id":838736,"avatar_url":"https://avatars.githubusercontent.com/u/838736?v=3","gravatar_id":"","url":"https://api.github.com/users/jelbourn","html_url":"https://github.com/jelbourn","followers_url":"https://api.github.com/users/jelbourn/followers","following_url":"https://api.github.com/users/jelbourn/following{/other_user}","gists_url":"https://api.github.com/users/jelbourn/gists{/gist_id}","starred_url":"https://api.github.com/users/jelbourn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelbourn/subscriptions","organizations_url":"https://api.github.com/users/jelbourn/orgs","repos_url":"https://api.github.com/users/jelbourn/repos","events_url":"https://api.github.com/users/jelbourn/events{/privacy}","received_events_url":"https://api.github.com/users/jelbourn/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":10,"state":"open","created_at":"2016-02-25T18:36:14Z","updated_at":"2016-03-18T17:19:41Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-03-17T09:23:25Z","updated_at":"2016-03-18T18:13:58Z","closed_at":null,"body":"Using `alpha.1` with `webpack` you might run into this kind of error:\r\n```\r\nERROR in ./~/@angular2-material/core/annotations/one-of.ts\r\nModule parse failed: /opt/senergy/iris-app/node_modules/@angular2-material/core/annotations/one-of.ts Line 1: Unexpected token\r\nYou may need an appropriate loader to handle this file type.\r\n| import {isPresent} from 'angular2/src/facade/lang';\r\n| \r\n| \r\n@ ./~/@angular2-material/sidenav/sidenav.js 24:15-52\r\n\r\nERROR in ./~/@angular2-material/core/rtl/dir.ts\r\nModule parse failed: /opt/senergy/iris-app/node_modules/@angular2-material/core/rtl/dir.ts Line 1: Unexpected token\r\nYou may need an appropriate loader to handle this file type.\r\n| import {EventEmitter} from 'angular2/src/facade/async';\r\n| import {Directive, HostBinding, Output, Input} from 'angular2/core';\r\n| import {OneOf} from '../annotations/one-of';\r\n @ ./~/@angular2-material/sidenav/sidenav.js 23:12-38\r\n```\r\n\r\nThe cause is that the compiled `sidnav.js` and `dir.js` tries to require the ts files instead of the compiled js ones. \r\n\r\n**Workaround**\r\nOpen `dir.js` and locate the line\r\n```\r\nvar one_of_1 = require('../annotations/one-of');\r\n``` \r\n(around line 12) and add the js extension to the req'd module, so it should look like this\r\n```\r\nvar one_of_1 = require('../annotations/one-of.js');\r\n```\r\n\r\nDo the same in `sidenav.js`, i.e. make sure you have something like this around line 23-24\r\n```\r\nvar dir_1 = require('../core/rtl/dir.js');\r\nvar one_of_1 = require('../core/annotations/one-of.js');\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/angular/material2/issues/comments/198478754","html_url":"https://github.com/angular/material2/issues/189#issuecomment-198478754","issue_url":"https://api.github.com/repos/angular/material2/issues/189","id":198478754,"user":{"login":"alexeagle","id":47395,"avatar_url":"https://avatars.githubusercontent.com/u/47395?v=3","gravatar_id":"","url":"https://api.github.com/users/alexeagle","html_url":"https://github.com/alexeagle","followers_url":"https://api.github.com/users/alexeagle/followers","following_url":"https://api.github.com/users/alexeagle/following{/other_user}","gists_url":"https://api.github.com/users/alexeagle/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeagle/subscriptions","organizations_url":"https://api.github.com/users/alexeagle/orgs","repos_url":"https://api.github.com/users/alexeagle/repos","events_url":"https://api.github.com/users/alexeagle/events{/privacy}","received_events_url":"https://api.github.com/users/alexeagle/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T18:13:57Z","updated_at":"2016-03-18T18:13:57Z","body":"You can do that, but be careful, it allows you to use eg. `readonly`\nmodifier and ship a library that only works for users with ts@next.\nYou should add a travis build target that explicitly tests the releasable\nartifacts against any TS version you support for users.\nangular/angular is not doing this well either, blocked on broccoli fixes.\n\nOn Thu, Mar 17, 2016 at 8:16 PM Rob Wormald <notifications@github.com>\nwrote:\n\n> note that @alexeagle is moving angular core to the above style of config as\n> well.\n>\n> On Thu, Mar 17, 2016 at 7:19 PM Jeremy Elbourn <notifications@github.com>\n> wrote:\n>\n> > The plan: have the release script replace relative path references to\n> core\n> > with @angular2-material/core\n> >\n> > —\n> > You are receiving this because you were mentioned.\n> > Reply to this email directly or view it on GitHub\n> > <https://github.com/angular/material2/issues/189#issuecomment-198166558>\n> >\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/angular/material2/issues/189#issuecomment-198182480>\n>\n"}}