{"action":"created","issue":{"url":"https://api.github.com/repos/CompuIves/codesandbox-client/issues/1127","repository_url":"https://api.github.com/repos/CompuIves/codesandbox-client","labels_url":"https://api.github.com/repos/CompuIves/codesandbox-client/issues/1127/labels{/name}","comments_url":"https://api.github.com/repos/CompuIves/codesandbox-client/issues/1127/comments","events_url":"https://api.github.com/repos/CompuIves/codesandbox-client/issues/1127/events","html_url":"https://github.com/CompuIves/codesandbox-client/issues/1127","id":365155769,"node_id":"MDU6SXNzdWUzNjUxNTU3Njk=","number":1127,"title":"[bug] Dependencies of ambient type packages are ignored","user":{"login":"mike-north","id":558005,"node_id":"MDQ6VXNlcjU1ODAwNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/558005?v=4","gravatar_id":"","url":"https://api.github.com/users/mike-north","html_url":"https://github.com/mike-north","followers_url":"https://api.github.com/users/mike-north/followers","following_url":"https://api.github.com/users/mike-north/following{/other_user}","gists_url":"https://api.github.com/users/mike-north/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-north/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-north/subscriptions","organizations_url":"https://api.github.com/users/mike-north/orgs","repos_url":"https://api.github.com/users/mike-north/repos","events_url":"https://api.github.com/users/mike-north/events{/privacy}","received_events_url":"https://api.github.com/users/mike-north/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-29T18:29:31Z","updated_at":"2018-09-29T20:01:57Z","closed_at":null,"author_association":"NONE","body":"# 🐛 bug report\r\n\r\n## Description of the problem\r\n\r\nDependencies of TypeScript types (`@types/*`) packages are provided as type information for sandbox editor.\r\n\r\n## How has this issue affected you? \r\nWhen using ambient types that have dependencies, my sandbox indicates false type-check errors due to missing (ignored by CSB) type information \r\n\r\n## What are you trying to accomplish?\r\nI'm trying to use CSB for TypeScript development, and having parity in terms of ability to use ambient type information is a core feature I'd depend on.\r\n\r\nHere's a concrete example. I have a sandbox with `package.json` like\r\n```json\r\n  \"devDependencies\": {\r\n    \"@types/jest\": \"^22.1.3\",\r\n    \"@types/node\": \"^9.4.6\",\r\n    \"@types/react\": \"^16.0.0\",\r\n    \"@types/react-dom\": \"^16.0.0\",\r\n    \"typescript\": \"^2.7.2\"\r\n  }\r\n```\r\nthe `@types/react` package has a dependency on `@types/prop-types`\r\n![screen shot 2018-09-29 at 10 56 49 am](https://user-images.githubusercontent.com/558005/46249097-3be4c200-c3d8-11e8-9f33-8ea348943843.png)\r\n\r\nIf I download this CSB and `npm install`, I'll get a types folder like this\r\n![screen shot 2018-09-29 at 11 02 10 am](https://user-images.githubusercontent.com/558005/46249102-5159ec00-c3d8-11e8-86c9-dd0cce7113d1.png)\r\n\r\nand because `node_modules/@types` [is regarded as a default typeRoot](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)\r\n> By default all visible “@types” packages are included in your compilation. Packages in node_modules/@types of any enclosing folder are considered visible; specifically, that means packages within ./node_modules/@types/, ../node_modules/@types/, ../../node_modules/@types/, and so on.\r\n\r\nI should be able to use the type information from `@types/prop-types`. CSB seems to completely ignore these transitive dependencies\r\n\r\n![screen shot 2018-09-29 at 11 26 53 am](https://user-images.githubusercontent.com/558005/46249239-a696fd00-c3da-11e8-9c4b-e98c33dedd0a.png)\r\n![screen shot 2018-09-29 at 11 17 08 am](https://user-images.githubusercontent.com/558005/46249240-ac8cde00-c3da-11e8-855f-b15d0bab904d.png)\r\n\r\n### Workaround\r\n\r\nIn this example, adding `@types/prop-types` to `package.json` and refreshing solves the problem\r\n\r\n![screen shot 2018-09-29 at 11 29 00 am](https://user-images.githubusercontent.com/558005/46249251-e1993080-c3da-11e8-9316-2ae3302cc84f.png)\r\n\r\n\r\n###  Link to sandbox: [link](https://codesandbox.io/s/2zpw43vxoy)\r\n### Your Environment\r\n| Software         | Name/Version|\r\n| ---------------- | ---------- |\r\n| Сodesandbox  |  `PROD-1538077445-546871f`\r\n| Browser | Brave `Version 0.55.10 Chromium: 70.0.3538.22 (Official Build) beta (64-bit)`\r\n| Operating System | `OS X 10.14.1 Beta (18B45d)`"},"comment":{"url":"https://api.github.com/repos/CompuIves/codesandbox-client/issues/comments/425671980","html_url":"https://github.com/CompuIves/codesandbox-client/issues/1127#issuecomment-425671980","issue_url":"https://api.github.com/repos/CompuIves/codesandbox-client/issues/1127","id":425671980,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTY3MTk4MA==","user":{"login":"CompuIves","id":587016,"node_id":"MDQ6VXNlcjU4NzAxNg==","avatar_url":"https://avatars3.githubusercontent.com/u/587016?v=4","gravatar_id":"","url":"https://api.github.com/users/CompuIves","html_url":"https://github.com/CompuIves","followers_url":"https://api.github.com/users/CompuIves/followers","following_url":"https://api.github.com/users/CompuIves/following{/other_user}","gists_url":"https://api.github.com/users/CompuIves/gists{/gist_id}","starred_url":"https://api.github.com/users/CompuIves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CompuIves/subscriptions","organizations_url":"https://api.github.com/users/CompuIves/orgs","repos_url":"https://api.github.com/users/CompuIves/repos","events_url":"https://api.github.com/users/CompuIves/events{/privacy}","received_events_url":"https://api.github.com/users/CompuIves/received_events","type":"User","site_admin":false},"created_at":"2018-09-29T20:01:57Z","updated_at":"2018-09-29T20:01:57Z","author_association":"OWNER","body":"This is a very good one! We should check for transient dependencies and add those too. This happens in `fetch-dependency-typings`. I'll mark it as bug."}}
{"actor":{"display_login":"CompuIves"}}