Skip to content

Dom types not usable in nodejs (Cannot find name 'HTMLElement') #389

Description

@pxDot

In backend nodejs projects the DOM types (HTMLElement) are only accessible if included explicitly by e.g. "lib": ["ES2020", "dom"] in tsconfig. Building without the included dom types gives the following error:

node_modules/juice/juice.d.ts:27:36 - error TS2304: Cannot find name 'HTMLElement'.

27   export let heightElements: HTMLElement[];
                                      ~~~~~~~~~~~
node_modules/juice/juice.d.ts:29:39 - error TS2304: Cannot find name 'HTMLElement'.

29   export let nonVisualElements: HTMLElement[];
                                         ~~~~~~~~~~~
node_modules/juice/juice.d.ts:31:35 - error TS2304: Cannot find name 'HTMLElement'.

31   export let tableElements: HTMLElement[];
                                     ~~~~~~~~~~~
node_modules/juice/juice.d.ts:32:35 - error TS2304: Cannot find name 'HTMLElement'.

32   export let widthElements: HTMLElement[];

Including all of the dom types only for the HTMLElement type seems like a bad idea and introducing alot of bloat.

Is there any workaround or possibility for another usable type here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions