remix-run / remix

Build Better Websites. Create modern, resilient user experiences with web fundamentals.
https://remix.run
MIT License
30.17k stars 2.56k forks source link

@remix-run/node@2.15.0 + typescript@5.7.2 = 'bytes' is missing in type 'NodeOnDiskFile' #10264

Open AviVahl opened 1 week ago

AviVahl commented 1 week ago

Reproduction

mkdir test-remix
cd test-remix
npm init -y
npm i @remix-run/node typescript @types/node@22
npx tsc --init --skipLibCheck false
echo "export * from '@remix-run/node';" > a.ts
npx tsc --noEmit

# see type error

System Info

Not system-specific.
Happens on projects with `skipLibCheck` set to false.

Used Package Manager

npm

Expected Behavior

No type errors

Actual Behavior

node_modules/@remix-run/node/dist/upload/fileUploadHandler.d.ts:47:22 - error TS2420: Class 'NodeOnDiskFile' incorrectly implements interface 'Omit<File, "constructor">'.
  Property 'bytes' is missing in type 'NodeOnDiskFile' but required in type 'Omit<File, "constructor">'.

47 export declare class NodeOnDiskFile implements Omit<File, "constructor"> {
                        ~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3442:5
    3442     bytes(): Promise<Uint8Array>;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'bytes' is declared here.

Found 1 error in node_modules/@remix-run/node/dist/upload/fileUploadHandler.d.ts:47
RobertGemmaJr commented 6 days ago

+1 on this, just did an npm upgrade and am getting the same error