Title: Module request specifier for a non JS file does not pick up matching definition files · Issue #49970 · microsoft/TypeScript · GitHub
Open Graph Title: Module request specifier for a non JS file does not pick up matching definition files · Issue #49970 · microsoft/TypeScript
X Title: Module request specifier for a non JS file does not pick up matching definition files · Issue #49970 · microsoft/TypeScript
Description: Bug Report .d.ts files are not picked up for files that do not contain a .js extension in the module request specifier. This happens when using the following configuration: "moduleResolution": "node16" in tsconfig.json "type": "module" i...
Open Graph Description: Bug Report .d.ts files are not picked up for files that do not contain a .js extension in the module request specifier. This happens when using the following configuration: "moduleResolution": "nod...
X Description: Bug Report .d.ts files are not picked up for files that do not contain a .js extension in the module request specifier. This happens when using the following configuration: "moduleResolution&q...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/49970
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Module request specifier for a non JS file does not pick up matching definition files","articleBody":"# Bug Report\r\n\r\n`.d.ts` files are not picked up for files that do not contain a `.js` extension in the module request specifier.\r\n\r\nThis happens when using the following configuration:\r\n\r\n- \"moduleResolution\": \"node16\" in tsconfig.json\r\n- \"type\": \"module\" in package.json\r\n\r\n### 🔎 Search Terms\r\n\r\ndefinition files, non js, third party\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nThis reproduces on version `4.7.4`, but I think this issue exists since TypeScript began supporting `\"type\": \"module\"` configuration.\r\n\r\n- This is the behavior in every version I tried, and I reviewed the FAQ for entries about definition files\r\n\r\n### ⏯ Playground Link\r\n\r\nNo playground as this reproduction requires multiple files.\r\n\r\n### 💻 Code\r\n\r\nMinimal reproduction repo - https://github.com/barak007/type-module-ts-bug\r\n\r\n### 🙁 Actual behavior\r\n\r\nThe `component.ts` file, imports the `component.st.css` file, but the `component.st.css.d.ts` file is not picked up, and the import is not resolved.\r\n\r\n### 🙂 Expected behavior\r\n\r\nPick up the module definition for the `.st.css` file and allow using it.\r\n","author":{"url":"https://github.com/tomrav","@type":"Person","name":"tomrav"},"datePublished":"2022-07-20T10:02:46Z","url":"https://github.com/microsoft/TypeScript/issues/49970"}
| 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:1ca30bc4-34c9-a09f-21fc-2ea9bbbb6ed7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A51C:27D3AD:CC4A0D:104748D:6B00FF17 |
| html-safe-nonce | a7c135af326dc2e7b097fdb220e63d0eab3e725a10cafad2cfd09063ab6377a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTFDOjI3RDNBRDpDQzRBMEQ6MTA0NzQ4RDo2QjAwRkYxNyIsInZpc2l0b3JfaWQiOiI5MDQxNTE2MDg4MTgwOTMyMzc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7d187849bbf502d9b8324e2abde8ba4b6f4c54d402385c4d8874859e061d5add |
| hovercard-subject-tag | issue:1310783451 |
| 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/49970/issue_layout |
| twitter:image | https://opengraph.githubassets.com/41f6fb75a077ffeaee7ce12900bc267385df004c80c72bf597b1585016d2b91f/microsoft/TypeScript/issues/49970 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/41f6fb75a077ffeaee7ce12900bc267385df004c80c72bf597b1585016d2b91f/microsoft/TypeScript/issues/49970 |
| og:image:alt | Bug Report .d.ts files are not picked up for files that do not contain a .js extension in the module request specifier. This happens when using the following configuration: "moduleResolution": "nod... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tomrav |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width