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

[fix] "Cannot find name 'HTMLElement')." Underlying package Juice is abandoned #438

Closed
3 tasks done
Wandang opened this issue Jun 14, 2022 · 5 comments
Closed
3 tasks done
Labels

Comments

@Wandang
Copy link

Wandang commented Jun 14, 2022

Describe the bug

Node.js version: Node 16.13.0

OS version: Mac

Description:
Using email-template 9.x in our project does not compile. It results in an error triggered by an underlying package juice, which is no longer maintained (current maintainer posted that he is searching for someone to continue maintaining).

The bug itself was posted there as well:

Automattic/juice#389

Actual behavior

Error output:

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

27   export let heightElements: HTMLElement[];
                                ~~~~~~~~~~~

node_modules/juice/juice.d.ts:29:33 - error TS2304: Cannot find name 'HTMLElement'.

29   export let nonVisualElements: HTMLElement[];
                                   ~~~~~~~~~~~

node_modules/juice/juice.d.ts:31:29 - error TS2304: Cannot find name 'HTMLElement'.

31   export let tableElements: HTMLElement[];
                               ~~~~~~~~~~~

node_modules/juice/juice.d.ts:32:29 - error TS2304: Cannot find name 'HTMLElement'.

32   export let widthElements: HTMLElement[];

Expected behavior

Compiling/starting the project works. Maybe another css-injector should be supplemented?

For now I applied the fix suggested inside the linked issue:

    "lib": ["ES2020","DOM"],

Which solves the issue for now.

Code to reproduce

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
@Wandang Wandang added the bug label Jun 14, 2022
@titanism
Copy link
Contributor

We don't support TypeScript. If you want to submit a PR to fix this, we're open to it. We also suggest you contribute to the juice package to help resolve the issue (we will not be doing this as we do not support TS nor use TS).

@boredland
Copy link

If you want to submit a PR to fix this

do you mean a transformation into typescript or a bugfix regarding that issue? I'd be open to give the typescript-transformation a try, if there is a chance we could get that merged. From a first glance, most modules already have typescript support built-in, so this should be only a matter of cleaning up the class a bit.

@titanism
Copy link
Contributor

I'd review a PR or could have someone look at it for us.

@titanism
Copy link
Contributor

Oh sorry, no transformation into TS - a bugfix for the underlying issue is probably the route to go? We will def be in pure vanilla JS for the future and present.

@boredland
Copy link

Ok, good to know. Nah, won't do that, sorry.

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

No branches or pull requests

3 participants