dask / dask-labextension

JupyterLab extension for Dask
BSD 3-Clause "New" or "Revised" License
311 stars 62 forks source link

JLab 4.0 side-effect: Class 'RenderedCommon' incorrectly implements interface 'IRenderer'. #260

Closed jhgoebbert closed 1 year ago

jhgoebbert commented 1 year ago

dask-labextension fails to build for JupyterLab 3.6.3

node_modules/@jupyterlab/rendermime/lib/widgets.d.ts(8,31): error TS2420: Class 'RenderedCommon' incorrectly implements interface 'IRenderer'.
        The types of 'title.owner.layout' are incompatible between these types.
          Type 'import("<..>/dask_labextension/dask_labextension-6.1.0/node_modules/@lumino/widgets/types/layout").Layout' is not assignable to type 'import("<..>/dask_labextension/dask_labextension-6.1.0/node_modules/@jupyterlab/rendermime-interfaces/node_modules/@lumino/widgets/types/layout").Layout'.
            Property '[Symbol.iterator]' is missing in type 'import("<..>/dask_labextension/dask_labextension-6.1.0/node_modules/@lumino/widgets/types/layout").Layout' but required in type 'import("<..>/dask_labextension/dask_labextension-6.1.0/node_modules/@jupyterlab/rendermime-interfaces/node_modules/@lumino/widgets/types/layout").Layout'.
      error Command failed with exit code 1.

I was assuming that this is the case because "@jupyterlab/rendermime-interfaces": "^3.0.0", is missing in package.json
and dask-labextension is not yet ready for JLab 4.x but uses here a too modern node-modules of it. But just adding this to package.json results in the same error.

jhgoebbert commented 1 year ago

@jupyterlab/rendermime-interfaces version 3.8 was released 4 days ago and pulls @lumino/widgets in version 2.1.1 -> https://github.com/jupyterlab/jupyterlab/blob/v4.0.0/packages/rendermime-interfaces/package.json#L35 This results in two different versions of lumino and the mismatch described above.

@jupyterlab/rendermime-interfaces new version nummer should have better be choosen to be 4.0 But a simple workaround could be to limit @jupyterlab/rendermime-interfaces in package.json to a max of 3.6.3

jhgoebbert commented 1 year ago

This seems to be recognized as a bug in JupyterLab here https://github.com/jupyterlab/jupyterlab/issues/14335#issuecomment-1553340328
Until this is fixed dask-labextension cannot be installed from source anymore.

jimdigriz commented 1 year ago

I had the same problem in our own private and public extensions, I was able to use the following to break out of the ghetto...

"resolutions": {
  "@jupyterlab/rendermime-interfaces": "^3.0.0 <=3.6.3"
}

Hope it works for you.

jhgoebbert commented 1 year ago

Hi @jimdigriz , I tried the same patch but it failed for me because then I was stuck in jupyterlab 3.6.3 here: https://github.com/jupyterlab/jupyterlab/blob/v3.6.3/packages/docregistry/package.json#L52

jimdigriz commented 1 year ago

Hi @jimdigriz , I tried the same patch but it failed for me because then I was stuck in jupyterlab 3.6.3 here: https://github.com/jupyterlab/jupyterlab/blob/v3.6.3/packages/docregistry/package.json#L52

We are using JupyterLab 3.4.6...

jhgoebbert commented 1 year ago

It got fixed with https://github.com/jupyterlab/jupyterlab/commit/5b334692b251af0156ed1a4e9298f2bc1f279c9e and will be part of the upcoming JupyterLab 3.6.5. Hence, I close the issue now.

mrocklin commented 1 year ago

Thanks!

On Mon, Jun 5, 2023 at 11:06 AM Jens Henrik Goebbert < @.***> wrote:

Closed #260 https://github.com/dask/dask-labextension/issues/260 as completed.

— Reply to this email directly, view it on GitHub https://github.com/dask/dask-labextension/issues/260#event-9430931857, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACKZTFY5XNSJBSOALZPZ6LXJWVUBANCNFSM6AAAAAAYHNWE4A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jhgoebbert commented 1 year ago

@jupyterlab/rendermime-interfaces 3.8.2 was released yesterday including this patch https://github.com/jupyterlab/jupyterlab/pull/14618 . But it seems that this does not fix it, yet. https://github.com/jupyterlab/jupyterlab/issues/14335#issuecomment-1584026710

jhgoebbert commented 1 year ago

I still cannot install the latest dask-labextension for the latest JupyterLab 3 (3.6.4, 3.6.5). Can anyone confirm that? ... or can confirm that dask-labextension works with the latest JupyterLab 3

      node_modules/@jupyterlab/rendermime/lib/widgets.d.ts(8,31): error TS2420: Class 'RenderedCommon' incorrectly implements interface 'IRenderer'.
        The types of 'title.owner.layout' are incompatible between these types.
          Type 'import("dask_labextension-6.1.0/node_modules/@lumino/widgets/types/layout").Layout' is not assignable to type 'import("dask_labextension-6.1.0/node_modules/@jupyterlab/rendermime-interfaces/node_modules/@lumino/widgets/types/layout").Layout'.
            Property '[Symbol.iterator]' is missing in type 'import("dask_labextension-6.1.0/node_modules/@lumino/widgets/types/layout").Layout' but required in type 'import("dask_labextension-6.1.0/node_modules/@jupyterlab/rendermime-interfaces/node_modules/@lumino/widgets/types/layout").Layout'.

more details: https://github.com/jupyterlab/jupyterlab/issues/14335#issuecomment-1584026710

jhgoebbert commented 1 year ago

Here is the reason why: https://github.com/jupyterlab/jupyterlab/issues/14335#issuecomment-1611739321

ian-r-rose commented 1 year ago

@jhgoebbert Apologies for the slow reply, and thank you for all your detective work here. We've just cut another release for JupyterLab 3 that should fix this issue, can you confirm that it resolves it for you?

Another release supporting JupyterLab 4 will be forthcoming.

jhgoebbert commented 1 year ago

Hi @ian-r-rose
these are great news. I have build our environment with the latest dask and can confirm that this resolves the issue.
Thank you