Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Remix.run projects start with type errors #7384

Closed
1 task done
dantman opened this issue Sep 8, 2023 · 1 comment
Closed
1 task done

New Remix.run projects start with type errors #7384

dantman opened this issue Sep 8, 2023 · 1 comment
Labels
bug:unverified duplicate This issue or pull request already exists

Comments

@dantman
Copy link

dantman commented Sep 8, 2023

What version of Remix are you using?

latest, also verified in pre

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

npx create-remix@latest remix-tsc-latest # Just the basics, Remix App Server, TypeScript, Yes
cd remix-tsc-latest/
npm run typecheck

Also verify that the issue remains in the next version:

npx create-remix@pre remix-tsc-pre # Yes, Yes
cd remix-tsc-pre/
npm run typecheck

Expected Behavior

No type errors in a new project.

Actual Behavior

Remix seems to start with a couple type errors:

> typecheck
> tsc

node_modules/@remix-run/node/dist/fetch.d.ts:15:9 - error TS2416: Property 'headers' in type 'NodeRequest' is not assignable to the same property in base type 'Request'.
  Property 'getSetCookie' is missing in type 'import("/tmp/remix-tsc-latest/node_modules/@remix-run/web-fetch/dist/src/headers").default' but required in type 'Headers'.

15     get headers(): WebHeaders;
           ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:13447:5
    13447     getSetCookie(): string[];
              ~~~~~~~~~~~~~~~~~~~~~~~~~
    'getSetCookie' is declared here.

node_modules/@remix-run/node/dist/fetch.d.ts:16:5 - error TS2416: Property 'clone' in type 'NodeRequest' is not assignable to the same property in base type 'Request'.
  Type '() => NodeRequest' is not assignable to type '() => Request'.
    Call signature return types 'NodeRequest' and 'Request' are incompatible.
      The types of 'headers' are incompatible between these types.
        Type 'import("/tmp/remix-tsc-latest/node_modules/@remix-run/web-fetch/dist/src/headers").default' is not assignable to type 'Headers'.

16     clone(): NodeRequest;
       ~~~~~

node_modules/@remix-run/node/dist/fetch.d.ts:19:9 - error TS2416: Property 'headers' in type 'NodeResponse' is not assignable to the same property in base type 'Response'.
  Type 'import("/tmp/remix-tsc-latest/node_modules/@remix-run/web-fetch/dist/src/headers").default' is not assignable to type 'Headers'.

19     get headers(): WebHeaders;
           ~~~~~~~

node_modules/@remix-run/node/dist/fetch.d.ts:20:5 - error TS2416: Property 'clone' in type 'NodeResponse' is not assignable to the same property in base type 'Response'.
  Type '() => NodeResponse' is not assignable to type '() => Response'.
    Call signature return types 'NodeResponse' and 'Response' are incompatible.
      The types of 'headers' are incompatible between these types.
        Type 'import("/tmp/remix-tsc-latest/node_modules/@remix-run/web-fetch/dist/src/headers").default' is not assignable to type 'Headers'.

20     clone(): NodeResponse;
       ~~~~~

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

47 export declare class NodeOnDiskFile implements File {
                        ~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3124:5
    3124     prototype: Blob;
             ~~~~~~~~~
    'prototype' is declared here.

node_modules/@remix-run/web-fetch/dist/src/headers.d.ts:19:22 - error TS2420: Class 'import("/tmp/remix-tsc-latest/node_modules/@remix-run/web-fetch/dist/src/headers").default' incorrectly implements interface 'Headers'.
  Property 'getSetCookie' is missing in type 'import("/tmp/remix-tsc-latest/node_modules/@remix-run/web-fetch/dist/src/headers").default' but required in type 'Headers'.

19 export default class Headers extends URLSearchParams implements globalThis.Headers {
                        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:13447:5
    13447     getSetCookie(): string[];
              ~~~~~~~~~~~~~~~~~~~~~~~~~
    'getSetCookie' is declared here.

node_modules/@types/glob/index.d.ts:29:42 - error TS2694: Namespace '"/tmp/remix-tsc-latest/node_modules/minimatch/dist/cjs/index"' has no exported member 'IOptions'.

29     interface IOptions extends minimatch.IOptions {
                                            ~~~~~~~~

node_modules/@types/glob/index.d.ts:74:30 - error TS2724: '"/tmp/remix-tsc-latest/node_modules/minimatch/dist/cjs/index"' has no exported member named 'IMinimatch'. Did you mean 'Minimatch'?

74         minimatch: minimatch.IMinimatch;
                                ~~~~~~~~~~


Found 8 errors in 4 files.

Errors  Files
     4  node_modules/@remix-run/node/dist/fetch.d.ts:15
     1  node_modules/@remix-run/node/dist/upload/fileUploadHandler.d.ts:47
     1  node_modules/@remix-run/web-fetch/dist/src/headers.d.ts:19
     2  node_modules/@types/glob/index.d.ts:29
@MichaelDeBoey
Copy link
Member

Duplicate of #4371, #7317 & #7067

@MichaelDeBoey MichaelDeBoey closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2023
@MichaelDeBoey MichaelDeBoey added the duplicate This issue or pull request already exists label Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:unverified duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants