typescript-go
typescript-go copied to clipboard
TS2307 with `@octokit/core` in tsgo but not tsc
Steps to reproduce
package.json:
{
"dependencies": {
"@octokit/core": "7.0.3"
}
}
tsconfig.json:
{
"compilerOptions": {
"skipLibCheck": true,
}
}
test.ts:
import { OctokitOptions } from '@octokit/core/dist-types/types';
Behavior with [email protected]
No error.
Behavior with tsgo
$ tsgo --version
Version 7.0.0-dev.20251205.1
$ tsgo
test.ts:1:32 - error TS2307: Cannot find module '@octokit/core/dist-types/types' or its corresponding type declarations.
1 import { OctokitOptions } from '@octokit/core/dist-types/types';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in test.ts:1
That import only worked due to defaulting to an older resolution mode in 5.9, which are deprecated in 6.0 and removed in 7.0.
If you use a newer resolution mode, you will see this behavior in 5.9 too, because the package's export map does not allow that file to be imported.
https://app.unpkg.com/@octokit/[email protected]/files/package.json#L56
You should import /types instead, based on their map.