phovea / phovea_clue

The foundation for Vistories: CLUE for provenance tracking and visualization
http://clue.caleydo.org/
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

CircleCI build error: `Property 'dataset' does not exist on type 'Element'.` #189

Closed thinkh closed 4 years ago

thinkh commented 4 years ago

Steps to reproduce

  1. See CircleCI build https://circleci.com/gh/phovea/phovea_clue/363 or run npm run build:web locally

Observed behavior

> phovea_clue@5.0.1-SNAPSHOT compile /home/circleci/phovea
> tsc

src/menu/ProvenanceGraphMenu.ts:198:33 - error TS2339: Property 'dataset' does not exist on type 'Element'.

198           const isSelect = this.dataset.action === 'select';
                                    ~~~~~~~

Found 1 error.

Expected behavior

The build should run successfully.

thinkh commented 4 years ago

The line belongs to this function:

https://github.com/phovea/phovea_clue/blob/008a426c572b99448e67bde1aa0c162c92662e0c/src/menu/ProvenanceGraphMenu.ts#L197-L201

It looks like jQuery typings have changed.

Comparing the dependencies of the errored with the last successful Circle build shows that the jQuery typings version has been updated:

 ├─┬ phovea_ui@4.0.1-SNAPSHOT (github:phovea/phovea_ui#1f0e6d7d99e44e2e7942bdc552ef0703b81ef8bb)
 │ ├── @types/bootstrap@3.3.32
-│ ├── @types/jquery@3.3.34
+│ ├── @types/jquery@3.3.36
 │ ├── bootstrap-sass@3.3.7
 │ ├── font-awesome@4.7.0
 │ ├── jquery@3.4.1

Checking npm shows that @types/jquery@3.3.36 was released 16 hours ago.

Checking the jquery directory in the source repository shows that PR https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44051 got merged.

grafik

Following to this PR reveals that the signature of .find() was changed from HTMLElement to Element.

grafik

According to the lib.dom.ts the Element does not contain dataset property.

A solution is shown in the test of the PR:

             var $list = $($item.find("a").attr("href"))
-                .find(".connectedSortable");
+                .find<HTMLElement>(".connectedSortable");