error TS2688: Cannot find type definition file for 'foo'.
  The file is in the program because:
    Entry point for implicit type library 'foo'
/app.ts(1,35): error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
/app.ts(2,34): error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
/app.ts(3,35): error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?


!!! error TS2688: Cannot find type definition file for 'foo'.
!!! error TS2688:   The file is in the program because:
!!! error TS2688:     Entry point for implicit type library 'foo'
==== /node_modules/@types/foo/package.json (0 errors) ====
    {
      "name": "@types/foo",
      "version": "1.0.0",
      "exports": {
        ".": {
          "import": "./index.d.mts",
          "require": "./index.d.cts"
        }
      }
    }
    
==== /node_modules/@types/foo/index.d.mts (0 errors) ====
    export declare const x: "module";
    
==== /node_modules/@types/foo/index.d.cts (0 errors) ====
    export declare const x: "script";
    
==== /app.ts (3 errors) ====
    import type { x as Default } from "foo";
                                      ~~~~~
!!! error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
    import type { x as Import } from "foo" assert { "resolution-mode": "import" };
                                     ~~~~~
!!! error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
    import type { x as Require } from "foo" assert { "resolution-mode": "require" };
                                      ~~~~~
!!! error TS2792: Cannot find module 'foo'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?
    type _Default = typeof Default;
    type _Import = typeof Import;
    type _Require = typeof Require;
    
    // resolution-mode does not enforce file extension in `bundler`, just sets conditions
    import type { x as ImportRelative } from "./other" assert { "resolution-mode": "import" };
    import type { x as RequireRelative } from "./other" assert { "resolution-mode": "require" };
    type _ImportRelative = typeof ImportRelative;
    type _RequireRelative = typeof RequireRelative;
    
    export {
      _Default,
      _Import,
      _Require,
      _ImportRelative,
      _RequireRelative
    }
    
==== /other.ts (0 errors) ====
    export const x = "other";
    