Title: TypeScript 5.4 import path completion results in unintended paths · Issue #58034 · microsoft/TypeScript · GitHub
Open Graph Title: TypeScript 5.4 import path completion results in unintended paths · Issue #58034 · microsoft/TypeScript
X Title: TypeScript 5.4 import path completion results in unintended paths · Issue #58034 · microsoft/TypeScript
Description: Type: Bug After upgrading TypeScript to 5.4, import path completion did changed its behavior in my project. TypeScript 5.3 import { foo } from './myModule' TypeScript 5.4 import { foo } from 'path/to/myModule' The project defines its bas...
Open Graph Description: Type: Bug After upgrading TypeScript to 5.4, import path completion did changed its behavior in my project. TypeScript 5.3 import { foo } from './myModule' TypeScript 5.4 import { foo } from 'path/...
X Description: Type: Bug After upgrading TypeScript to 5.4, import path completion did changed its behavior in my project. TypeScript 5.3 import { foo } from './myModule' TypeScript 5.4 import { foo } fro...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/58034
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeScript 5.4 import path completion results in unintended paths","articleBody":"Type: \u003cb\u003eBug\u003c/b\u003e\r\n\r\nAfter upgrading TypeScript to 5.4, import path completion did changed its behavior in my project.\r\n\r\nTypeScript 5.3\r\n\r\n```\r\nimport { foo } from './myModule'\r\n```\r\n\r\nTypeScript 5.4\r\n\r\n```\r\nimport { foo } from 'path/to/myModule'\r\n```\r\n\r\nThe project defines its `baseUrl` in `tsconfig.json` like below.\r\n\r\n```\r\n\"baseUrl\": \"./\",\r\n```\r\n\r\nThe import path seems to start with the `baseUrl`, therefore, when I disable `baseUrl` in `tsconfig.json`, the import path becomes relative. \r\n\r\nThis behavior appears when I set `TypeScript › Preferences: Import Module Specifier` as `shortest` or `project-relative`.\r\n\r\nI'm sorry, but I haven't been able to create a minimal reproducible case yet. Does anyone know anything about this?\r\n\r\nMy environment is below.\r\n\r\n```\r\nVersion: 1.87.2\r\nCommit: 863d2581ecda6849923a2118d93a088b0745d9d6\r\nDate: 2024-03-08T15:21:31.043Z\r\nElectron: 27.3.2\r\nElectronBuildId: 26836302\r\nChromium: 118.0.5993.159\r\nNode.js: 18.17.1\r\nV8: 11.8.172.18-electron.0\r\nOS: Darwin x64 22.6.0\r\n```\r\n\r\n\r\nVS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:21:31.043Z)\r\nOS version: Darwin x64 22.6.0\r\nModes:\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eSystem Info\u003c/summary\u003e\r\n\r\n|Item|Value|\r\n|---|---|\r\n|CPUs|Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600)|\r\n|GPU Status|2d_canvas: enabled\u003cbr\u003ecanvas_oop_rasterization: disabled_off\u003cbr\u003edirect_rendering_display_compositor: disabled_off_ok\u003cbr\u003egpu_compositing: enabled\u003cbr\u003emultiple_raster_threads: enabled_on\u003cbr\u003eopengl: enabled_on\u003cbr\u003erasterization: enabled\u003cbr\u003eraw_draw: disabled_off_ok\u003cbr\u003eskia_graphite: disabled_off\u003cbr\u003evideo_decode: enabled\u003cbr\u003evideo_encode: enabled\u003cbr\u003ewebgl: enabled\u003cbr\u003ewebgl2: enabled\u003cbr\u003ewebgpu: enabled|\r\n|Load (avg)|4, 3, 3|\r\n|Memory (System)|64.00GB (6.75GB free)|\r\n|Process Argv|. --crash-reporter-id b27626fb-3484-4fce-a531-22e8618705e5|\r\n|Screen Reader|no|\r\n|VM|0%|\r\n\u003c/details\u003eExtensions: none\u003cdetails\u003e\r\n\u003csummary\u003eA/B Experiments\u003c/summary\u003e\r\n\r\n```\r\nvsliv368cf:30146710\r\nvspor879:30202332\r\nvspor708:30202333\r\nvspor363:30204092\r\nvscorecescf:30445987\r\nvscod805cf:30301675\r\nbinariesv615:30325510\r\nvsaa593:30376534\r\npy29gd2263:30899288\r\nc4g48928:30535728\r\nazure-dev_surveyone:30548225\r\n2i9eh265:30646982\r\n962ge761:30959799\r\npythongtdpath:30769146\r\nwelcomedialogc:30910334\r\npythonidxpt:30866567\r\npythonnoceb:30805159\r\nasynctok:30898717\r\npythontestfixt:30902429\r\npythonregdiag2:30936856\r\npyreplss1:30897532\r\npythonmypyd1:30879173\r\npythoncet0:30885854\r\nh48ei257:31000450\r\npythontbext0:30879054\r\naccentitlementst:30995554\r\ndsvsc016:30899300\r\ndsvsc017:30899301\r\ndsvsc018:30899302\r\ncppperfnew:31000557\r\nd34g3935:30971562\r\nfegfb526:30981948\r\nbg6jg535:30979843\r\nccp2r3:30993541\r\ndsvsc020:30976470\r\npythonait:31006305\r\njchc7451:30973076\r\ngee8j676:30988843\r\ndsvsc021:30996838\r\ng1icg217:30999571\r\n\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003c!-- generated by issue reporter --\u003e","author":{"url":"https://github.com/nekoya","@type":"Person","name":"nekoya"},"datePublished":"2024-04-02T10:26:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/58034/TypeScript/issues/58034"}
| 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:6ae9fcde-9dff-819a-d7c5-ff32223d359d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D126:17881E:1795A91:2126EDB:6A61CE26 |
| html-safe-nonce | 440ba62485760dc68785fe316326b096d4ccffa10e5e538c38155f50b4ce6d40 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTI2OjE3ODgxRToxNzk1QTkxOjIxMjZFREI6NkE2MUNFMjYiLCJ2aXNpdG9yX2lkIjoiNTYxNzAyMTY4OTYzNTM5MzA2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d475c63854388eeb5d41e8abeea3e5729a5b737522b2f8c081fa06f84d8f41ca |
| hovercard-subject-tag | issue:2220684874 |
| 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/58034/issue_layout |
| twitter:image | https://opengraph.githubassets.com/46e120d8031630d21a8c5564a4c86c194b963a6c9e88a0a3b1cd8bfc061b4786/microsoft/TypeScript/issues/58034 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/46e120d8031630d21a8c5564a4c86c194b963a6c9e88a0a3b1cd8bfc061b4786/microsoft/TypeScript/issues/58034 |
| og:image:alt | Type: Bug After upgrading TypeScript to 5.4, import path completion did changed its behavior in my project. TypeScript 5.3 import { foo } from './myModule' TypeScript 5.4 import { foo } from 'path/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nekoya |
| hostname | github.com |
| expected-hostname | github.com |
| None | b2de8c74e5e61e893155ba46ee41bc66170c1644cb795adefa8386d490f7781c |
| 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 | d1866027ded575df8a15c731dd8b9986c9483ceb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width