Title: Import declarations seems to break `namespace` compilation · Issue #24432 · microsoft/TypeScript · GitHub
Open Graph Title: Import declarations seems to break `namespace` compilation · Issue #24432 · microsoft/TypeScript
X Title: Import declarations seems to break `namespace` compilation · Issue #24432 · microsoft/TypeScript
Description: TypeScript Version: 2.8.1 Search Terms: namespace import Code import { Moment } from 'moment' declare namespace Models { export interface ITimeFrame { [key: string]: Array<{ foo: number start: Moment end: Moment }> } } Expected behavior:...
Open Graph Description: TypeScript Version: 2.8.1 Search Terms: namespace import Code import { Moment } from 'moment' declare namespace Models { export interface ITimeFrame { [key: string]: Array<{ foo: number start: Mome...
X Description: TypeScript Version: 2.8.1 Search Terms: namespace import Code import { Moment } from 'moment' declare namespace Models { export interface ITimeFrame { [key: string]: Array<{ foo: number ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/24432
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Import declarations seems to break `namespace` compilation","articleBody":"\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 2.8.1\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** \r\nnamespace\r\nimport\r\n**Code**\r\n\r\n```ts\r\nimport { Moment } from 'moment'\r\n\r\ndeclare namespace Models {\r\n export interface ITimeFrame {\r\n [key: string]: Array\u003c{\r\n foo: number\r\n start: Moment\r\n end: Moment\r\n }>\r\n }\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nCompiles fine\r\n\r\n**Actual behavior:**\r\nWebstorm spits out an error.\r\n\r\n```\r\n**/service.ts\r\nError:(12, 17) TS2503: Cannot find namespace 'Models'.\r\nError:(30, 30) TS2503: Cannot find namespace 'Models'.\r\nError:(99, 11) TS2503: Cannot find namespace 'Models'.\r\nError:(100, 6) TS2503: Cannot find namespace 'Models'.\r\nError:(119, 11) TS2503: Cannot find namespace 'Models'.\r\nError:(120, 6) TS2503: Cannot find namespace 'Models'.\r\nError:(146, 11) TS2503: Cannot find namespace 'Models'.\r\nError:(146, 56) TS2503: Cannot find namespace 'Models'.\r\nError:(147, 6) TS2503: Cannot find namespace 'Models'.\r\n```\r\n\r\nonce `import` declaration and \r\n```\r\nstart: Moment\r\nend: Moment\r\n```\r\n\r\nare removed, it compiles fine.\r\n\r\nalso, even `import` declaration by itself, without \r\n```\r\nstart: Moment\r\nend: Moment\r\n```\r\n\r\nbreaks compilation with the same result.\r\n\r\ntsconfig:\r\n\r\n```\r\n{\r\n \"compilerOptions\": {\r\n \"target\": \"es2015\",\r\n \"module\": \"commonjs\",\r\n \"noImplicitAny\": false,\r\n \"alwaysStrict\": true,\r\n \"strictNullChecks\": true,\r\n \"experimentalDecorators\": true,\r\n \"emitDecoratorMetadata\": true\r\n },\r\n \"exclude\":[\r\n \"node_modules\",\r\n \"./src/**/*.spec.ts\"\r\n ]\r\n}\r\n```","author":{"url":"https://github.com/nikkatalnikov","@type":"Person","name":"nikkatalnikov"},"datePublished":"2018-05-26T15:09:54Z","url":"https://github.com/microsoft/TypeScript/issues/24432"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7ec3596d-c43a-2f89-4ed7-71d223979dad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9DB4:3ABDFB:628B62:86BF9A:6B047591 |
| html-safe-nonce | e53be35d7b6f83d58d257a32e5fd9c757c06fc7c719c0a418bee02974b5a13a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REI0OjNBQkRGQjo2MjhCNjI6ODZCRjlBOjZCMDQ3NTkxIiwidmlzaXRvcl9pZCI6IjM2NTkxNzY0NDcwODU2NzE4MjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 59739767649e68756226ad1df5b1e442f59de29b93b6a7d07fa05f119d6951a7 |
| hovercard-subject-tag | issue:326745026 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/24432/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b69091620d4b6ee9b7cd85a555cf2e30b4f411089d5b6542138b0c62bc656052/microsoft/TypeScript/issues/24432 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b69091620d4b6ee9b7cd85a555cf2e30b4f411089d5b6542138b0c62bc656052/microsoft/TypeScript/issues/24432 |
| og:image:alt | TypeScript Version: 2.8.1 Search Terms: namespace import Code import { Moment } from 'moment' declare namespace Models { export interface ITimeFrame { [key: string]: Array<{ foo: number start: Mome... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nikkatalnikov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width