{"action":"created","issue":{"url":"https://api.github.com/repos/mobxjs/mobx/issues/1808","repository_url":"https://api.github.com/repos/mobxjs/mobx","labels_url":"https://api.github.com/repos/mobxjs/mobx/issues/1808/labels{/name}","comments_url":"https://api.github.com/repos/mobxjs/mobx/issues/1808/comments","events_url":"https://api.github.com/repos/mobxjs/mobx/issues/1808/events","html_url":"https://github.com/mobxjs/mobx/issues/1808","id":380133745,"node_id":"MDU6SXNzdWUzODAxMzM3NDU=","number":1808,"title":"@observable/@action + interface build error","user":{"login":"rainmanhhh","id":13862623,"node_id":"MDQ6VXNlcjEzODYyNjIz","avatar_url":"https://avatars0.githubusercontent.com/u/13862623?v=4","gravatar_id":"","url":"https://api.github.com/users/rainmanhhh","html_url":"https://github.com/rainmanhhh","followers_url":"https://api.github.com/users/rainmanhhh/followers","following_url":"https://api.github.com/users/rainmanhhh/following{/other_user}","gists_url":"https://api.github.com/users/rainmanhhh/gists{/gist_id}","starred_url":"https://api.github.com/users/rainmanhhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainmanhhh/subscriptions","organizations_url":"https://api.github.com/users/rainmanhhh/orgs","repos_url":"https://api.github.com/users/rainmanhhh/repos","events_url":"https://api.github.com/users/rainmanhhh/events{/privacy}","received_events_url":"https://api.github.com/users/rainmanhhh/received_events","type":"User","site_admin":false},"labels":[{"id":428344630,"node_id":"MDU6TGFiZWw0MjgzNDQ2MzA=","url":"https://api.github.com/repos/mobxjs/mobx/labels/cannot%20reproduce","name":"cannot reproduce","color":"f8efcd","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-13T09:32:34Z","updated_at":"2018-11-30T15:41:00Z","closed_at":null,"author_association":"NONE","body":"what did I do:\r\n1. create an empty react project with create-react-app --script-version=react-scripts-ts mobxtest and add deps: mobx & mobx-react\r\n2. add a intf.ts in src dir:\r\n```\r\nexport interface ITest { // if ITest is a class, build passed\r\n  a?: string\r\n}\r\n\r\nexport class A {  // if A is an interface, build passed\r\n}\r\n```\r\n3. add a Store.ts in src dir:\r\n```\r\nimport { action, observable } from 'mobx'\r\nimport { ITest } from './intf'\r\n\r\nexport class Store {\r\n  @observable public t: ITest   // can't work with @observable\r\n  @observable public testData: string = ''\r\n\r\n  @action.bound\r\n  public test(iTest: ITest) {  // can't work with @action.bound\r\n    return this.testData = iTest.toString()\r\n  }\r\n  @action\r\n  public test2 = (iTest: ITest) => {  // can't work with @action\r\n    return this.testData = iTest.toString()\r\n  }\r\n}\r\nexport const store = new Store()\r\n```\r\n4. use store in App.tsx\r\n```\r\nimport * as React from 'react';\r\nimport './App.css';\r\n\r\nimport { observer } from 'mobx-react'\r\nimport logo from './logo.svg';\r\nimport { store } from './store'\r\n\r\n@observer\r\nclass App extends React.Component {\r\n  public render() {\r\n    return (\r\n      <div className=\"App\">\r\n        <header className=\"App-header\">\r\n          <img src={logo} className=\"App-logo\" alt=\"logo\" />\r\n          <h1 className=\"App-title\">Welcome to React</h1>\r\n        </header>\r\n        {store.testData}  // use store\r\n      </div>\r\n    );\r\n  }\r\n}\r\nexport default App;\r\n```\r\n5. tsc compile success, but build with webpack report error:\r\n`'./intf' does not contain an export named 'ITest'`\r\n\r\n**interface from file contains classes can't work with @observable or @action**"},"comment":{"url":"https://api.github.com/repos/mobxjs/mobx/issues/comments/443243110","html_url":"https://github.com/mobxjs/mobx/issues/1808#issuecomment-443243110","issue_url":"https://api.github.com/repos/mobxjs/mobx/issues/1808","id":443243110,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzI0MzExMA==","user":{"login":"mweststrate","id":1820292,"node_id":"MDQ6VXNlcjE4MjAyOTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1820292?v=4","gravatar_id":"","url":"https://api.github.com/users/mweststrate","html_url":"https://github.com/mweststrate","followers_url":"https://api.github.com/users/mweststrate/followers","following_url":"https://api.github.com/users/mweststrate/following{/other_user}","gists_url":"https://api.github.com/users/mweststrate/gists{/gist_id}","starred_url":"https://api.github.com/users/mweststrate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mweststrate/subscriptions","organizations_url":"https://api.github.com/users/mweststrate/orgs","repos_url":"https://api.github.com/users/mweststrate/repos","events_url":"https://api.github.com/users/mweststrate/events{/privacy}","received_events_url":"https://api.github.com/users/mweststrate/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T15:40:55Z","updated_at":"2018-11-30T15:40:55Z","author_association":"MEMBER","body":"@rainmanhhh I don't see any error in the codesandbox you've linked. Please provide a better reproduction"}}
{"actor":{"display_login":"mweststrate"}}