jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

Error in console caused by jupyter-ai chat component (":first-child" is potentially unsafe)

Open krassowski opened this issue 1 year ago • 0 comments
trafficstars

Description

When opening chat in JupyterLab a warning is shown:

The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".

Using debugger I can confirm that this is an issue in jupyter-ai, caused by this inline style:

https://github.com/jupyterlab/jupyter-ai/blob/4b45ec23f3e16a0fa29718eefaf37064f59cafe6/packages/jupyter-ai/src/components/settings/existing-api-keys.tsx#L37-L42

While the warning is likely spurious, jupyter-ai (or its dependencies as is the case here) should not spam dev console as it wastes dev time.

Reproduce

  1. Open the dev tools
  2. Open the chat
  3. See warning in dev console

image

Expected behavior

No errors

Context

Tip of main corresponding to https://github.com/jupyterlab/jupyter-ai/releases/tag/v2.22.0

krassowski avatar Sep 07 '24 10:09 krassowski