{"action":"created","issue":{"url":"https://api.github.com/repos/trufflesuite/truffle/issues/1254","repository_url":"https://api.github.com/repos/trufflesuite/truffle","labels_url":"https://api.github.com/repos/trufflesuite/truffle/issues/1254/labels{/name}","comments_url":"https://api.github.com/repos/trufflesuite/truffle/issues/1254/comments","events_url":"https://api.github.com/repos/trufflesuite/truffle/issues/1254/events","html_url":"https://github.com/trufflesuite/truffle/issues/1254","id":357028686,"node_id":"MDU6SXNzdWUzNTcwMjg2ODY=","number":1254,"title":"MyEvent.watch() returns `watch is not a function` error (V5)","user":{"login":"tarekskr","id":377350,"node_id":"MDQ6VXNlcjM3NzM1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/377350?v=4","gravatar_id":"","url":"https://api.github.com/users/tarekskr","html_url":"https://github.com/tarekskr","followers_url":"https://api.github.com/users/tarekskr/followers","following_url":"https://api.github.com/users/tarekskr/following{/other_user}","gists_url":"https://api.github.com/users/tarekskr/gists{/gist_id}","starred_url":"https://api.github.com/users/tarekskr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarekskr/subscriptions","organizations_url":"https://api.github.com/users/tarekskr/orgs","repos_url":"https://api.github.com/users/tarekskr/repos","events_url":"https://api.github.com/users/tarekskr/events{/privacy}","received_events_url":"https://api.github.com/users/tarekskr/received_events","type":"User","site_admin":false},"labels":[{"id":971534911,"node_id":"MDU6TGFiZWw5NzE1MzQ5MTE=","url":"https://api.github.com/repos/trufflesuite/truffle/labels/Next","name":"Next","color":"5319e7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-09-05T01:08:22Z","updated_at":"2018-09-26T18:50:45Z","closed_at":"2018-09-26T18:50:45Z","author_association":"NONE","body":"\r\n---------------------------\r\n\r\n## Issue\r\n\r\nUsing MyEvent.watch() now raises an error.\r\n\r\n## Steps to Reproduce\r\n\r\n```\r\ncomponentDidMount = async () => {\r\n    try {\r\n      // Get network provider and web3 instance.\r\n      const web3 = await getWeb3();\r\n\r\n      // Get the contract instance.\r\n      const Contract = truffleContract(MyContract);\r\n      Contract.setProvider(web3.currentProvider);\r\n      const contractInstance = await Contract.deployed();\r\n\r\n      // Watch for MyEvent\r\n      contractInstance.MyEvent().watch((error, result) => {});\r\n\r\n\r\n    } catch (error) {\r\n      console.log(error);  // always gives: TypeError: contractInstance.MyEvent(...).watch is not a function\r\n    }\r\n  };\r\n```\r\n\r\n## Expected Behavior\r\n\r\nAs of `truffle-contract` v.1.1.11, the above code worked flawlessly.\r\n\r\n## Actual Results\r\n\r\nNow it gives the following error:\r\n```\r\nTypeError: contractInstance.MyEvent(...).watch is not a function\r\n```\r\n\r\n## Environment\r\n\r\n* Operating System: macOS 10.13.6\r\n* Ethereum client: Ganache v1.2.2\r\n* truffle-contract version: 4.0.0-next.0\r\n* Truffle version (`truffle version`): 4.1.14\r\n* node version (`node --version`): 8.10.0\r\n* npm version (`npm --version`): 6.4.1\r\n"},"comment":{"url":"https://api.github.com/repos/trufflesuite/truffle/issues/comments/424829107","html_url":"https://github.com/trufflesuite/truffle/issues/1254#issuecomment-424829107","issue_url":"https://api.github.com/repos/trufflesuite/truffle/issues/1254","id":424829107,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDgyOTEwNw==","user":{"login":"tarekskr","id":377350,"node_id":"MDQ6VXNlcjM3NzM1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/377350?v=4","gravatar_id":"","url":"https://api.github.com/users/tarekskr","html_url":"https://github.com/tarekskr","followers_url":"https://api.github.com/users/tarekskr/followers","following_url":"https://api.github.com/users/tarekskr/following{/other_user}","gists_url":"https://api.github.com/users/tarekskr/gists{/gist_id}","starred_url":"https://api.github.com/users/tarekskr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarekskr/subscriptions","organizations_url":"https://api.github.com/users/tarekskr/orgs","repos_url":"https://api.github.com/users/tarekskr/repos","events_url":"https://api.github.com/users/tarekskr/events{/privacy}","received_events_url":"https://api.github.com/users/tarekskr/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T18:50:45Z","updated_at":"2018-09-26T18:50:45Z","author_association":"NONE","body":"@gnidan awesome! Thanks again @cgewecke for all your help."}}
{"actor":{"display_login":"tarekskr"}}