Skip to content

TypeScript build hangs when importing Fetcher type from react-router #14789

@alexplkvf

Description

@alexplkvf

Reproduction

Can be reproduced in following repo:
https://stackblitz.com/edit/react-router-tsc-hangs

The project is a simple library with one function:

import type { Fetcher } from 'react-router'

export const bar = (fetcher: Fetcher) => fetcher.state === 'loading'
  1. Open project
  2. Run the following command npm i && npm run build

tsc process will continue to work indefinitely while actively consuming memory

So far I've reproduced it in Stackblitz environment, in MacOS environment and in node:20-alpine container

System Info

System:
    OS: Linux 6.8 Alpine Linux
    CPU: (5) arm64 unknown
    Memory: 7.19 GB / 7.73 GB
    Container: Yes
    Shell: Unknown - /bin/sh
  Binaries:
    Node: 20.20.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
  npmPackages:
    react-router: 7.13.0 => 7.13.0 
    typescript: 5.9.3 => 5.9.3

Used Package Manager

npm

Expected Behavior

Simple library successfully built

Actual Behavior

Build process never finishes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions