Microsoft/TypeScript
GitHub ã§èŠãTS does not support resolving paths with colons
Open
#57,529 opened on 2024幎2æ25æ¥
BugDomain: Module ResolutionHelp Wanted
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð Search Terms
https://github.com/microsoft/TypeScript/issues?q=is%3Aissue+colon+exports+is%3Aclosed
colon, exports
ð Version & Regression Information
- This is the behavior in every version I tried
⯠Playground Link
ð» Code
Consumer module:
import a from 'my-library';
import b from 'my-library/foo';
import c from 'my-library/foo:virtual';
import d from 'my-library/bar';
import e from 'my-library/colon:here';
console.log({ a, b, c, d, e });
package.json for my-library:
{
"name": "my-library",
"version": "0.0.1",
"type": "module",
"exports": {
".": {
"types": "./foo.d.ts",
"default": "./foo.js"
},
"./foo": {
"types": "./foo.d.ts",
"import": "./foo.js"
},
"./foo:virtual": {
"types": "./foo.d.ts",
"default": "./foo.js"
},
"./*": {
"types": "./*.d.ts",
"default": "./*.js"
}
},
"scripts": {
"lint": "attw --pack; pnpm publint"
},
"dependencies": {
"@arethetypeswrong/cli": "^0.14.1",
"publint": "^0.2.7"
}
}
every imported module is supposed to resolve, and then print:
{ a: 2, b: 2, c: 2, d: 2, e: 'two' }
(pnpm start in the consumer package in the repro link shows this)
ð Actual behavior
Errors, cannot find module
ð Expected behavior
align with JS, resolve the module
Additional information about the issue
No response