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

Sentry middleware, type import fails build #427

Open
razzeee opened this issue Mar 21, 2024 · 4 comments
Open

Sentry middleware, type import fails build #427

razzeee opened this issue Mar 21, 2024 · 4 comments

Comments

@razzeee
Copy link

razzeee commented Mar 21, 2024

I'm trying to use the sentry middleware, with a strict typescript hono project.

See the project at flathub-infra/website#2736 for reference

yarn build                                                                                                                                                                            ─╯
node_modules/toucan-js/dist/transports/types.d.ts:1:23 - error TS2688: Cannot find type definition file for '@cloudflare/workers-types'.

1 /// <reference types="@cloudflare/workers-types" />
                        ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/toucan-js/dist/types.d.ts:1:23 - error TS2688: Cannot find type definition file for '@cloudflare/workers-types'.

1 /// <reference types="@cloudflare/workers-types" />
                        ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/toucan-js/dist/types.d.ts:23:16 - error TS2304: Cannot find name 'ExecutionContext'.

23     waitUntil: ExecutionContext['waitUntil'];
                  ~~~~~~~~~~~~~~~~


Found 3 errors in 2 files.

Errors  Files
     1  node_modules/toucan-js/dist/transports/types.d.ts:1
     2  node_modules/toucan-js/dist/types.d.ts:1
@yusukebe
Copy link
Member

Hi @razzeee

How about installing @cloudflare/workers-types?

npm i -D @cloudflare/workers-types

@razzeee
Copy link
Author

razzeee commented Mar 22, 2024

Seems to make it even worse

yarn build                                                                                                                                                                                                   ─╯
yarn run v1.22.19
warning package.json: No license field
$ tsc
node_modules/@cloudflare/workers-types/index.d.ts:17:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: DOMException, console, BufferSource, CompileError, RuntimeError, ValueType, Global, ImportValue, ModuleImports, Imports, ExportValue, Exports, Instance, Memory, ImportExportKind, Module, TableKind, Table, self, crypto, caches, performance, origin, PromiseRejectionEvent, Event, EventListener, EventListenerOrEventListenerObject, EventTarget, AbortController, AbortSignal, CustomEvent, Blob, File, CacheStorage, Cache, Crypto, SubtleCrypto, CryptoKey, TextDecoder, TextEncoder, FormData, HeadersInit, Headers, BodyInit, Response, RequestInfo, Request, ReadableStreamReadResult, ReadableStream, ReadableStreamDefaultReader, ReadableStreamBYOBReader, desiredSize, WritableStream, WritableStreamDefaultWriter, TransformStream, CompressionStream, DecompressionStream, TextEncoderStream, TextDecoderStream, ByteLengthQueuingStrategy, CountQueuingStrategy, URL, URLSearchParams, CloseEvent, MessageEvent, WebSocketEventMap, WebSocket

17 declare class DOMException extends Error {
   ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:23:1
    23 interface AddEventListenerOptions extends EventListenerOptions {
       ~~~~~~~~~
    Conflicts are in this file.

node_modules/@cloudflare/workers-types/index.d.ts:56:50 - error TS2508: No base constructor has the specified number of type arguments.

56 declare abstract class WorkerGlobalScope extends EventTarget<WorkerGlobalScopeEventMap> {
                                                    ~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:99:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'value' must be of type 'T', but here has type 'keyof ValueTypeMap'.

99     value: ValueType;
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:26884:9
    26884         value: T;
                  ~~~~~
    'value' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:249:12 - error TS2315: Type 'EventListenerOrEventListenerObject' is not generic.

249   handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:256:12 - error TS2315: Type 'EventListenerOrEventListenerObject' is not generic.

256   handler: EventListenerOrEventListenerObject<WorkerGlobalScopeEventMap[Type]>,
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:309:12 - error TS2315: Type 'Request' is not generic.

309   request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:352:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'transfer' must be of type 'Transferable[] | undefined', but here has type 'any[] | undefined'.

352   transfer?: any[];
      ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1857:5
    1857     transfer?: Transferable[];
             ~~~~~~~~
    'transfer' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:587:5 - error TS2315: Type 'EventListener' is not generic.

587 > = EventListener<EventType> | EventListenerObject<EventType>;
        ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:594:14 - error TS2315: Type 'EventListenerOrEventListenerObject' is not generic.

594     handler: EventListenerOrEventListenerObject<EventMap[Type]>,
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:599:14 - error TS2315: Type 'EventListenerOrEventListenerObject' is not generic.

599     handler: EventListenerOrEventListenerObject<EventMap[Type]>,
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:798:3 - error TS2687: All declarations of 'kty' must have identical modifiers.

798   kty: string;
      ~~~

node_modules/@cloudflare/workers-types/index.d.ts:798:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'kty' must be of type 'string | undefined', but here has type 'string'.

798   kty: string;
      ~~~

  node_modules/typescript/lib/lib.dom.d.ts:717:5
    717     kty?: string;
            ~~~
    'kty' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:980:3 - error TS2687: All declarations of 'tagName' must have identical modifiers.

980   tagName: string;
      ~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:981:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'attributes' must be of type 'NamedNodeMap', but here has type 'IterableIterator<string[]>'.

981   readonly attributes: IterableIterator<string[]>;
               ~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:7644:14
    7644     readonly attributes: NamedNodeMap;
                      ~~~~~~~~~~
    'attributes' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:983:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'namespaceURI' must be of type 'string | null', but here has type 'string'.

983   readonly namespaceURI: string;
               ~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:7682:14
    7682     readonly namespaceURI: string | null;
                      ~~~~~~~~~~~~
    'namespaceURI' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1059:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'body' must be of type 'ReadableStream<Uint8Array> | null', but here has type 'ReadableStream<any> | null'.

1059   readonly body: ReadableStream | null;
                ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3151:14
    3151     readonly body: ReadableStream<Uint8Array> | null;
                      ~~~~
    'body' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1092:5 - error TS2315: Type 'Request' is not generic.

1092 > = Request<CfHostMetadata, Cf> | string | URL;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:1097:22 - error TS2315: Type 'RequestInfo' is not generic.

1097   constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
                          ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:1098:12 - error TS2315: Type 'Request' is not generic.

1098   clone(): Request<CfHostMetadata, Cf>;
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:1124:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'redirect' must be of type 'RequestRedirect | undefined', but here has type 'string | undefined'.

1124   redirect?: string;
       ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1690:5
    1690     redirect?: RequestRedirect;
             ~~~~~~~~
    'redirect' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1465:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'highWaterMark' must be of type 'number | undefined', but here has type 'number | bigint | undefined'.

1465   highWaterMark?: number | bigint;
       ~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1287:5
    1287     highWaterMark?: number;
             ~~~~~~~~~~~~~
    'highWaterMark' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1466:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'size' must be of type 'QueuingStrategySize<T> | undefined', but here has type '((chunk: T) => number | bigint) | undefined'.

1466   size?: (chunk: T) => number | bigint;
       ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1288:5
    1288     size?: QueuingStrategySize<T>;
             ~~~~
    'size' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1469:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'type' must be of type 'undefined', but here has type 'string | undefined'.

1469   type?: string;
       ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1956:5
    1956     type?: undefined;
             ~~~~
    'type' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1470:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'start' must be of type 'UnderlyingSinkStartCallback | undefined', but here has type '((controller: WritableStreamDefaultController) => void | Promise<void>) | undefined'.

1470   start?: (controller: WritableStreamDefaultController) => void | Promise<void>;
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1955:5
    1955     start?: UnderlyingSinkStartCallback;
             ~~~~~
    'start' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1471:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'write' must be of type 'UnderlyingSinkWriteCallback<W> | undefined', but here has type '((chunk: W, controller: WritableStreamDefaultController) => void | Promise<void>) | undefined'.

1471   write?: (
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1957:5
    1957     write?: UnderlyingSinkWriteCallback<W>;
             ~~~~~
    'write' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1475:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'abort' must be of type 'UnderlyingSinkAbortCallback | undefined', but here has type '((reason: any) => void | Promise<void>) | undefined'.

1475   abort?: (reason: any) => void | Promise<void>;
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1953:5
    1953     abort?: UnderlyingSinkAbortCallback;
             ~~~~~
    'abort' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1476:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'close' must be of type 'UnderlyingSinkCloseCallback | undefined', but here has type '(() => void | Promise<void>) | undefined'.

1476   close?: () => void | Promise<void>;
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1954:5
    1954     close?: UnderlyingSinkCloseCallback;
             ~~~~~
    'close' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1481:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'start' must be of type '((controller: ReadableByteStreamController) => any) | undefined', but here has type '((controller: ReadableByteStreamController) => void | Promise<void>) | undefined'.

1481   start?: (controller: ReadableByteStreamController) => void | Promise<void>;
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1941:5
    1941     start?: (controller: ReadableByteStreamController) => any;
             ~~~~~
    'start' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1482:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'pull' must be of type '((controller: ReadableByteStreamController) => void | PromiseLike<void>) | undefined', but here has type '((controller: ReadableByteStreamController) => void | Promise<void>) | undefined'.

1482   pull?: (controller: ReadableByteStreamController) => void | Promise<void>;
       ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1940:5
    1940     pull?: (controller: ReadableByteStreamController) => void | PromiseLike<void>;
             ~~~~
    'pull' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1483:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'cancel' must be of type 'UnderlyingSourceCancelCallback | undefined', but here has type '((reason: any) => void | Promise<void>) | undefined'.

1483   cancel?: (reason: any) => void | Promise<void>;
       ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1939:5
    1939     cancel?: UnderlyingSourceCancelCallback;
             ~~~~~~
    'cancel' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1486:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'type' must be of type '"bytes" | undefined', but here has type '"" | undefined'.

1486   type?: "" | undefined;
       ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1965:5
    1965     type?: ReadableStreamType;
             ~~~~
    'type' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1487:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'start' must be of type 'UnderlyingSourceStartCallback<R> | undefined', but here has type '((controller: ReadableStreamDefaultController<R>) => void | Promise<void>) | undefined'.

1487   start?: (
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1964:5
    1964     start?: UnderlyingSourceStartCallback<R>;
             ~~~~~
    'start' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1490:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'pull' must be of type 'UnderlyingSourcePullCallback<R> | undefined', but here has type '((controller: ReadableStreamDefaultController<R>) => void | Promise<void>) | undefined'.

1490   pull?: (
       ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1963:5
    1963     pull?: UnderlyingSourcePullCallback<R>;
             ~~~~
    'pull' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1493:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'cancel' must be of type 'UnderlyingSourceCancelCallback | undefined', but here has type '((reason: any) => void | Promise<void>) | undefined'.

1493   cancel?: (reason: any) => void | Promise<void>;
       ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1962:5
    1962     cancel?: UnderlyingSourceCancelCallback;
             ~~~~~~
    'cancel' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1497:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'readableType' must be of type 'undefined', but here has type 'string | undefined'.

1497   readableType?: string;
       ~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1913:5
    1913     readableType?: undefined;
             ~~~~~~~~~~~~
    'readableType' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1498:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'writableType' must be of type 'undefined', but here has type 'string | undefined'.

1498   writableType?: string;
       ~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1916:5
    1916     writableType?: undefined;
             ~~~~~~~~~~~~
    'writableType' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1499:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'start' must be of type 'TransformerStartCallback<O> | undefined', but here has type '((controller: TransformStreamDefaultController<O>) => void | Promise<void>) | undefined'.

1499   start?: (
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1914:5
    1914     start?: TransformerStartCallback<O>;
             ~~~~~
    'start' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1502:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'transform' must be of type 'TransformerTransformCallback<I, O> | undefined', but here has type '((chunk: I, controller: TransformStreamDefaultController<O>) => void | Promise<void>) | undefined'.

1502   transform?: (
       ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1915:5
    1915     transform?: TransformerTransformCallback<I, O>;
             ~~~~~~~~~
    'transform' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1506:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'flush' must be of type 'TransformerFlushCallback<O> | undefined', but here has type '((controller: TransformStreamDefaultController<O>) => void | Promise<void>) | undefined'.

1506   flush?: (
       ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1912:5
    1912     flush?: TransformerFlushCallback<O>;
             ~~~~~
    'flush' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1599:3 - error TS2687: All declarations of 'mode' must have identical modifiers.

1599   mode: "byob";
       ~~~~

node_modules/@cloudflare/workers-types/index.d.ts:1599:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'mode' must be of type '"byob" | undefined', but here has type '"byob"'.

1599   mode: "byob";
       ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1637:5
    1637     mode?: ReadableStreamReaderMode;
             ~~~~
    'mode' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1602:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'view' must be of type 'ArrayBufferView | null', but here has type 'Uint8Array | null'.

1602   readonly view: Uint8Array | null;
                ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:18667:14
    18667     readonly view: ArrayBufferView | null;
                       ~~~~
    'view' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1955:3 - error TS2687: All declarations of 'data' must have identical modifiers.

1955   data: ArrayBuffer | string;
       ~~~~

node_modules/@cloudflare/workers-types/index.d.ts:1955:3 - error TS2717: Subsequent property declarations must have the same type.  Property 'data' must be of type 'T | undefined', but here has type 'string | ArrayBuffer'.

1955   data: ArrayBuffer | string;
       ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:976:5
    976     data?: T;
            ~~~~
    'data' was also declared here.

node_modules/@cloudflare/workers-types/index.d.ts:1971:33 - error TS2508: No base constructor has the specified number of type arguments.

1971 declare class WebSocket extends EventTarget<WebSocketEventMap> {
                                     ~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:3655:12 - error TS2315: Type 'Request' is not generic.

3655   request: Request<unknown, IncomingRequestCfProperties<unknown>>;
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@cloudflare/workers-types/index.d.ts:3674:12 - error TS2315: Type 'Request' is not generic.

3674   request: Request<unknown, IncomingRequestCfProperties<unknown>>;
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@types/react/index.d.ts:3979:78 - error TS2344: Type 'HTMLSelectElement' does not satisfy the constraint 'HTMLElement'.

3979         select: DetailedHTMLFactory<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
                                                                                  ~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:23:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: DOMException, console, BufferSource, CompileError, RuntimeError, ValueType, Global, ImportValue, ModuleImports, Imports, ExportValue, Exports, Instance, Memory, ImportExportKind, Module, TableKind, Table, self, crypto, caches, performance, origin, PromiseRejectionEvent, Event, EventListener, EventListenerOrEventListenerObject, EventTarget, AbortController, AbortSignal, CustomEvent, Blob, File, CacheStorage, Cache, Crypto, SubtleCrypto, CryptoKey, TextDecoder, TextEncoder, FormData, HeadersInit, Headers, BodyInit, Response, RequestInfo, Request, ReadableStreamReadResult, ReadableStream, ReadableStreamDefaultReader, ReadableStreamBYOBReader, desiredSize, WritableStream, WritableStreamDefaultWriter, TransformStream, CompressionStream, DecompressionStream, TextEncoderStream, TextDecoderStream, ByteLengthQueuingStrategy, CountQueuingStrategy, URL, URLSearchParams, CloseEvent, MessageEvent, WebSocketEventMap, WebSocket

23 interface AddEventListenerOptions extends EventListenerOptions {
   ~~~~~~~~~

  node_modules/@cloudflare/workers-types/index.d.ts:17:1
    17 declare class DOMException extends Error {
       ~~~~~~~
    Conflicts are in this file.

node_modules/typescript/lib/lib.dom.d.ts:717:5 - error TS2687: All declarations of 'kty' must have identical modifiers.

717     kty?: string;
        ~~~

node_modules/typescript/lib/lib.dom.d.ts:976:5 - error TS2687: All declarations of 'data' must have identical modifiers.

976     data?: T;
        ~~~~

node_modules/typescript/lib/lib.dom.d.ts:1637:5 - error TS2687: All declarations of 'mode' must have identical modifiers.

1637     mode?: ReadableStreamReaderMode;
         ~~~~

node_modules/typescript/lib/lib.dom.d.ts:5759:11 - error TS2430: Interface 'Comment' incorrectly extends interface 'CharacterData'.
  Types of property 'after' are incompatible.
    Type '(content: string, options?: ContentOptions | undefined) => Comment' is not assignable to type '(...nodes: (string | Node)[]) => void'.
      Types of parameters 'options' and 'nodes' are incompatible.
        Type 'string | Node' is not assignable to type 'ContentOptions | undefined'.
          Type 'string' has no properties in common with type 'ContentOptions'.

5759 interface Comment extends CharacterData {
               ~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:7297:101 - error TS2344: Type 'HTMLElementTagNameMap[K]' does not satisfy the constraint 'Element'.
  Type 'HTMLElement | HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | HTMLAnchorElement | ... 57 more ... | HTMLUListElement' is not assignable to type 'Element'.
    Type 'HTMLSelectElement' is not assignable to type 'Element'.
      The types returned by 'remove()' are incompatible between these types.
        Type 'void' is not assignable to type 'Element'.

7297     getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
                                                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:7642:11 - error TS2430: Interface 'Element' incorrectly extends interface 'ChildNode'.
  Types of property 'after' are incompatible.
    Type '(content: string, options?: ContentOptions | undefined) => Element' is not assignable to type '(...nodes: (string | Node)[]) => void'.
      Types of parameters 'options' and 'nodes' are incompatible.
        Type 'string | Node' is not assignable to type 'ContentOptions | undefined'.

7642 interface Element extends Node, ARIAMixin, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slottable {
               ~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:7642:11 - error TS2430: Interface 'Element' incorrectly extends interface 'ParentNode'.
  Types of property 'append' are incompatible.
    Type '(content: string, options?: ContentOptions | undefined) => Element' is not assignable to type '(...nodes: (string | Node)[]) => void'.
      Types of parameters 'options' and 'nodes' are incompatible.
        Type 'string | Node' is not assignable to type 'ContentOptions | undefined'.

7642 interface Element extends Node, ARIAMixin, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slottable {
               ~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:7723:14 - error TS2687: All declarations of 'tagName' must have identical modifiers.

7723     readonly tagName: string;
                  ~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:7776:101 - error TS2344: Type 'HTMLElementTagNameMap[K]' does not satisfy the constraint 'Element'.
  Type 'HTMLElement | HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | HTMLAnchorElement | ... 57 more ... | HTMLUListElement' is not assignable to type 'Element'.

7776     getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
                                                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:12411:11 - error TS2430: Interface 'HTMLSelectElement' incorrectly extends interface 'HTMLElement'.

12411 interface HTMLSelectElement extends HTMLElement {
                ~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:12411:11 - error TS2430: Interface 'HTMLSelectElement' incorrectly extends interface 'HTMLElement'.
  The types returned by 'remove()' are incompatible between these types.
    Type 'void' is not assignable to type 'Element'.

12411 interface HTMLSelectElement extends HTMLElement {
                ~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:22018:11 - error TS2430: Interface 'Text' incorrectly extends interface 'CharacterData'.
  Types of property 'after' are incompatible.
    Type '(content: string, options?: ContentOptions | undefined) => Text' is not assignable to type '(...nodes: (string | Node)[]) => void'.
      Types of parameters 'options' and 'nodes' are incompatible.
        Type 'string | Node' is not assignable to type 'ContentOptions | undefined'.

22018 interface Text extends CharacterData, Slottable {
                ~~~~


Found 61 errors in 3 files.

Errors  Files
    47  node_modules/@cloudflare/workers-types/index.d.ts:17
     1  node_modules/@types/react/index.d.ts:3979
    13  node_modules/typescript/lib/lib.dom.d.ts:23
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@yusukebe
Copy link
Member

@razzeee

The easiest way to solve it is by enabling skipLibCheck:

{
  "compilerOptions": {
    "skipLibCheck": true
  }
}

@razzeee
Copy link
Author

razzeee commented Mar 30, 2024

Yeah, seems to get around the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants