jupyterlab / extension-template

A `copier` template for JupyterLab extensions
Creative Commons Zero v1.0 Universal
49 stars 16 forks source link

Inclusion of `react-addons-linked-state-mixin` in `package.json` breaks compilation #82

Open krassowski opened 1 month ago

krassowski commented 1 month ago

When "@rjsf/core": "5.18.3" or newer is installed the compilation on https://github.com/jupyterlab/jupyterlab_apod/pull/20 fails:

node_modules/@rjsf/core/lib/components/Form.d.ts:292:76 - error TS2694: Namespace '"/node_modules/@types/react/jsx-runtime"' has no exported member 'JSX'.

292     renderErrors(registry: Registry<T, S, F>): import("react/jsx-runtime").JSX.Element | null;
                                                                               ~~~

node_modules/@rjsf/core/lib/components/Form.d.ts:367:43 - error TS2694: Namespace '"/node_modules/@types/react/jsx-runtime"' has no exported member 'JSX'.

367     render(): import("react/jsx-runtime").JSX.Element;
                                              ~~~

downgrading to 5.18.2 fixes the issue.

react-addons-linked-state-mixin was added in https://github.com/jupyterlab/extension-template/pull/38. Why is it needed?

krassowski commented 1 month ago

Of note, deduplication does not fix it. It looks like a more fundamental resolution error. So there are three solutions for the users:

krassowski commented 1 month ago

Nah, I think I was wrong about this. Back to debugging.

krassowski commented 1 month ago

No, actually both resolutions need to be set and react-addons-linked-state-mixin removed from dependencies to make https://github.com/jupyterlab/jupyterlab_apod/pull/20 pass. I think we need to change something so that extension tutorial can be followed without need for this but I have not attempted to reproduce this yet