DefinitelyTyped / DefinitelyTyped

The repository for high quality TypeScript type definitions.
Other
48.07k stars 30.01k forks source link

[@types/google-apps-script] mismatched type declerations between GAS and TS lib.dom #65682

Open idkhowisyourday opened 1 year ago

idkhowisyourday commented 1 year ago

When trying to compile my TypeScript project that utilizes Google Apps Script typings, I'm encountering the following error message:

node_modules/@types/google-apps-script/google-apps-script.base.d.ts:538:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'MimeType' must be of type '{ new (): MimeType; prototype: MimeType; }', but here has type 'MimeType'.

538 declare var MimeType: GoogleAppsScript.Base.MimeType;
                ~~~~~~~~

  ../../../../usr/local/lib/node_modules/typescript/lib/lib.dom.d.ts:15485:13
    15485 declare var MimeType: {
                      ~~~~~~~~
    'MimeType' was also declared here.

Found 1 error in node_modules/@types/google-apps-script/google-apps-script.base.d.ts:538

It seems that there is a mismatch in the type declaration of MimeType between node_modules/@types/google-apps-script/google-apps-script.base.d.ts and ../../../../usr/local/lib/node_modules/typescript/lib/lib.dom.d.ts.

sathishkumar294 commented 1 year ago

Any updates on this?

andrewdbond commented 10 months ago

The error can be resolved by adding "lib": ["ES2019"] to tsconfig.json. https://www.typescriptlang.org/tsconfig#lib

I also investigated when the error began: