{"id":15413958,"url":"https://github.com/myitcv/ts_react_node_types_repro","last_synced_at":"2025-11-08T11:30:44.510Z","repository":{"id":78276364,"uuid":"69917047","full_name":"myitcv/ts_react_node_types_repro","owner":"myitcv","description":"Repro for https://github.com/Microsoft/TypeScript/issues/11316","archived":false,"fork":false,"pushed_at":"2016-10-04T04:28:46.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T03:14:06.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myitcv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-03T22:43:33.000Z","updated_at":"2016-12-11T15:12:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9542706-f996-46d4-a968-6034abe05b6c","html_url":"https://github.com/myitcv/ts_react_node_types_repro","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"676cca2eda3a202b8c1b7664d4640cb9d24e7868"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myitcv%2Fts_react_node_types_repro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myitcv%2Fts_react_node_types_repro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myitcv%2Fts_react_node_types_repro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myitcv%2Fts_react_node_types_repro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myitcv","download_url":"https://codeload.github.com/myitcv/ts_react_node_types_repro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239552379,"owners_count":19657901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T16:59:13.604Z","updated_at":"2025-11-08T11:30:44.460Z","avatar_url":"https://github.com/myitcv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## `myitcv/ts_react_node_types_repro`\n\n```\ngit clone https://github.com/myitcv/ts_react_node_types_repro\ncd ts_react_node_types_repro\nnpm install\n./node_modules/.bin/jspm install\n```\n\nThen in a new terminal:\n\n```\n./node_modules/.bin/tsc -w\n```\n\nNotice this compiles without any errors. This is _not_ expected because `React` has not been imported.\n\nNow in another terminal:\n\n```\n./node_modules/.bin/http-server -c-1 -a localhost -p 8080\n```\n\nand browse to http://localhost:8080; observe the error in the console.\n\nSo at this point we have TypeScript code that compiles but that fails at runtime. This is _not_ expected or\ndesirable.\n\nNow uncomment the `import` at the top of `src/index.ts` and save. Notice this also compiles without errors; this is as\nexpected because we are correctly importing `React`. Reload in the browser and observe there is now no error in the\nconsole (instead the function is logged); this is as expected.\n\nNow switch your attention to `node_modules/@types/react/index.d.ts` and comment out the line:\n\n```\nexport as namespace React;\n```\n\nComment out the `import` in `src/index.ts` (effectively returning the file to its initial state) and observe\nyou now get compile errors as expected:\n\n```\nsrc/index.ts(3,13): error TS2304: Cannot find name 'React'.\nsrc/index.ts(6,12): error TS2304: Cannot find name 'React'.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyitcv%2Fts_react_node_types_repro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyitcv%2Fts_react_node_types_repro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyitcv%2Fts_react_node_types_repro/lists"}