Title: Module imports need to recognize/ignore the file extension · Issue #4595 · microsoft/TypeScript · GitHub
Open Graph Title: Module imports need to recognize/ignore the file extension · Issue #4595 · microsoft/TypeScript
X Title: Module imports need to recognize/ignore the file extension · Issue #4595 · microsoft/TypeScript
Description: Currently, TS can't find modules when you use a file extension in the import name (import {Foo} from './foo.ts';) - SystemJS updated and file extensions are now required (though the spec issue is still under discussion) on imports (witho...
Open Graph Description: Currently, TS can't find modules when you use a file extension in the import name (import {Foo} from './foo.ts';) - SystemJS updated and file extensions are now required (though the spec issue is s...
X Description: Currently, TS can't find modules when you use a file extension in the import name (import {Foo} from './foo.ts';) - SystemJS updated and file extensions are now required (though the spe...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/4595
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Module imports need to recognize/ignore the file extension","articleBody":"Currently, TS can't find modules when you use a file extension in the import name (`import {Foo} from './foo.ts';`) - [SystemJS updated](https://github.com/systemjs/systemjs/releases/tag/0.17.0) and file extensions are now [_required_](https://github.com/whatwg/loader/issues/52) (though the spec issue is still under discussion) on imports (without setting some legacy settings in `System.config`). So when compiling with `--module`, you can either have a functioning typechecker (no extensions on your imports) or a functioning runtime (`.js` on your imports, since your result files have `.js` extensions). This is complicated further by systemjs's [bundler](https://github.com/systemjs/builder), which looks for dependent files _before_ TS transpiles them, so you have to use `.ts` extensions on your imports so the _bundler_ can resolve the paths to real ones.\n\nThis extension madness is all incredibly awkward to work with, and I'm not sure if this needs module resolution logic updating on our part, arguing for old behavior on the loader spec, or talking to `systemjs` and having them change how they're finding modules ignoring the spec.\n","author":{"url":"https://github.com/weswigham","@type":"Person","name":"weswigham"},"datePublished":"2015-09-01T19:47:38Z","url":"https://github.com/microsoft/TypeScript/issues/4595"}
| 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:29a7f7b6-8de4-c90a-0694-f90edde440a1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A70E:188DB:B24D12:F3D103:6B048934 |
| html-safe-nonce | e2b2b735e49b365e538d487c2c0c14c366ef0f81baeb2aa7025dce1442aaf542 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzBFOjE4OERCOkIyNEQxMjpGM0QxMDM6NkIwNDg5MzQiLCJ2aXNpdG9yX2lkIjoiMzA3NzgzMTk0NzU5OTUxMzkwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b602991e572a5b0d286f286d0f540f06e4615bddcf6cd1219eff4729360c4f1b |
| hovercard-subject-tag | issue:104340155 |
| 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/4595/issue_layout |
| twitter:image | https://opengraph.githubassets.com/60cec27666de80e8225ee7cf99d89e6c5a1595d3dce402ec4b26a2d3e3fdd311/microsoft/TypeScript/issues/4595 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/60cec27666de80e8225ee7cf99d89e6c5a1595d3dce402ec4b26a2d3e3fdd311/microsoft/TypeScript/issues/4595 |
| og:image:alt | Currently, TS can't find modules when you use a file extension in the import name (import {Foo} from './foo.ts';) - SystemJS updated and file extensions are now required (though the spec issue is s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | weswigham |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70 |
| 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 | f5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8 |
| 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