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

Shipping .ts files in the published package causes errors #78

Open
pegiadise opened this issue May 29, 2023 · 0 comments
Open

Shipping .ts files in the published package causes errors #78

pegiadise opened this issue May 29, 2023 · 0 comments

Comments

@pegiadise
Copy link

pegiadise commented May 29, 2023

Unfortunately, shipping .ts files in your npm package causes errors that cannot be bypassed in vue-tsc and is generally not recommended. Is there a reason to ship .ts files on top of the js distributables and not prebuilt js with declaration files?

Example errors in snippet below:

../../node_modules/vue-waypoint/src/components/Waypoint/component.ts:63:58 - error TS2345: Argument of type '{ readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: ...; readonly length: number; item: (nameOrIndex?: string | undefined) => Element | ... 1 m...' is not assignable to parameter of type 'Element'.
  Types of property 'attributes' are incompatible.
    Type '{ [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: { readonly attributes: ...; ... 165 more ...; readonly assignedSlot: { ...; } | null; }; readonly length: number; ...' is not assignable to type 'NamedNodeMap'.
      'number' index signatures are incompatible.
        Type '{ readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: { readonly attributes: { [x: number]: ...; ... 8 more ...; [Symbol.iterator]: () => IterableIterator<...>; }; ... 165 more ...; r...' is not assignable to type 'Attr'.
          The types of 'ownerDocument.anchors' are incompatible between these types.
            Type '{ [x: number]: { charset: string; coords: string; download: string; hreflang: string; name: string; ping: string; referrerPolicy: string; rel: string; readonly relList: { [x: number]: string; readonly length: number; ... 13 more ...; [Symbol.iterator]: () => IterableIterator<...>; }; ... 308 more ...; username: stri...' is not assignable to type 'HTMLCollectionOf<HTMLAnchorElement>'.
              'number' index signatures are incompatible.
                Type '{ charset: string; coords: string; download: string; hreflang: string; name: string; ping: string; referrerPolicy: string; rel: string; readonly relList: { [x: number]: string; readonly length: number; value: string; ... 12 more ...; [Symbol.iterator]: () => IterableIterator<...>; }; ... 308 more ...; username: stri...' is not assignable to type 'HTMLAnchorElement'.
                  Types of property 'shadowRoot' are incompatible.
                    Type '{ readonly delegatesFocus: boolean; readonly host: { readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; ... 256 more ...; evaluate: (expression: string, contextNode: Node, resolver?: XPathNSRes...' is not assignable to type 'ShadowRoot | null'.
                      Type '{ readonly delegatesFocus: boolean; readonly host: { readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; ... 256 more ...; evaluate: (expression: string, contextNode: Node, resolver?: XPathNSRes...' is not assignable to type 'ShadowRoot'.
                        Types of property 'childNodes' are incompatible.
                          Type '{ [x: number]: { after: (...nodes: (string | Node)[]) => void; before: (...nodes: (string | Node)[]) => void; remove: () => void; replaceWith: (...nodes: (string | Node)[]) => void; readonly baseURI: string; ... 48 more ...; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, opt...' is not assignable to type 'NodeListOf<ChildNode>'.
                            'number' index signatures are incompatible.
                              Type '{ after: (...nodes: (string | Node)[]) => void; before: (...nodes: (string | Node)[]) => void; remove: () => void; replaceWith: (...nodes: (string | Node)[]) => void; readonly baseURI: string; ... 48 more ...; removeEventListener: (type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean ...' is not assignable to type 'ChildNode'.
                                Types of property 'parentElement' are incompatible.
                                  Type '{ accessKey: string; readonly accessKeyLabel: string; autocapitalize: string; dir: string; draggable: boolean; hidden: boolean; inert: boolean; innerText: string; lang: string; readonly offsetHeight: number; ... 281 more ...; focus: (options?: FocusOptions | undefined) => void; } | null' is not assignable to type 'HTMLElement | null'.
                                    Type '{ accessKey: string; readonly accessKeyLabel: string; autocapitalize: string; dir: string; draggable: boolean; hidden: boolean; inert: boolean; innerText: string; lang: string; readonly offsetHeight: number; ... 281 more ...; focus: (options?: FocusOptions | undefined) => void; }' is not assignable to type 'HTMLElement'.
                                      Types of property 'assignedSlot' are incompatible.
                                        Type '{ name: string; assign: (...nodes: (Element | Text)[]) => void; assignedElements: (options?: AssignedNodesOptions | undefined) => Element[]; ... 292 more ...; focus: (options?: FocusOptions | undefined) => void; } | null' is not assignable to type 'HTMLSlotElement | null'.
                                          Type '{ name: string; assign: (...nodes: (Element | Text)[]) => void; assignedElements: (options?: AssignedNodesOptions | undefined) => Element[]; ... 292 more ...; focus: (options?: FocusOptions | undefined) => void; }' is not assignable to type 'HTMLSlotElement'.
                                            The types of 'style.parentRule' are incompatible between these types.
                                              Type '{ cssText: string; readonly parentRule: ... | null; readonly parentStyleSheet: { readonly cssRules: { [x: number]: ...; readonly length: number; item: (index: number) => CSSRule | null; [Symbol.iterator]: () => IterableIterator<...>; }; ... 14 more ...; readonly type: string; } | null; ... 10 more ...; readonly SUPP...' is not assignable to type 'CSSRule | null'.
                                                Type '{ cssText: string; readonly parentRule: ... | null; readonly parentStyleSheet: { readonly cssRules: { [x: number]: ...; readonly length: number; item: (index: number) => CSSRule | null; [Symbol.iterator]: () => IterableIterator<...>; }; ... 14 more ...; readonly type: string; } | null; ... 10 more ...; readonly SUPP...' is not assignable to type 'CSSRule'.
                                                  Types of property 'parentStyleSheet' are incompatible.
                                                    Type '{ readonly cssRules: { [x: number]: { cssText: string; readonly parentRule: ... | null; readonly parentStyleSheet: ... | null; readonly type: number; readonly STYLE_RULE: 1; readonly CHARSET_RULE: 2; ... 7 more ...; readonly SUPPORTS_RULE: 12; }; readonly length: number; item: (index: number) => CSSRule | null; [Sym...' is not assignable to type 'CSSStyleSheet | null'.
                                                      Type '{ readonly cssRules: { [x: number]: { cssText: string; readonly parentRule: ... | null; readonly parentStyleSheet: ... | null; readonly type: number; readonly STYLE_RULE: 1; readonly CHARSET_RULE: 2; ... 7 more ...; readonly SUPPORTS_RULE: 12; }; readonly length: number; item: (index: number) => CSSRule | null; [Sym...' is not assignable to type 'CSSStyleSheet'.
                                                        Types of property 'ownerNode' are incompatible.
                                                          Type '{ readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: ...; readonly length: number; item: (nameOrIndex?: string | undefined) => Element | ... 1 m...' is not assignable to type 'Element | ProcessingInstruction | null'.
                                                            Type '{ readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: ...; readonly length: number; item: (nameOrIndex?: string | undefined) => Element | ... 1 m...' is not assignable to type 'Element | ProcessingInstruction | null'.

63       if (activable.value) return observer.value.observe(element.value);
                                                            ~~~~~~~~~~~~~~

../../node_modules/vue-waypoint/src/components/Waypoint/component.ts:64:44 - error TS2345: Argument of type '{ readonly attributes: { [x: number]: { readonly localName: string; readonly name: string; readonly namespaceURI: string | null; readonly ownerDocument: { readonly URL: string; alinkColor: string; readonly all: { [x: number]: ...; readonly length: number; item: (nameOrIndex?: string | undefined) => Element | ... 1 m...' is not assignable to parameter of type 'Element'.

64       else return observer.value.unobserve(element.value);
                                              ~~~~~~~~~~~~~~


Found 2 errors in the same file, starting at: ../../node_modules/vue-waypoint/src/components/Waypoint/component.ts:63
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

1 participant