Struggling with using `ISettingRegistry` in a jlab4 extension

I’m targetting jlab4 and am trying to add settings to an existing extension
using as a guideline the @jupyterlab-examples/settings tutorial extension from

And I’m facing a typescript compilation issue that I have not yet been able to figure out

I have this in my index.ts

import { ISettingRegistry } from '@jupyterlab/settingregistry'

and then

const plugin: JupyterFrontEndPlugin<void> = {
  id: 'jupyterlab-tpt:plugin',
  autoStart: true,
  requires: [ICommandPalette, INotebookTracker, ISettingRegistry],
  activate: (
    app: JupyterFrontEnd,
    palette: ICommandPalette,
    notebookTracker: INotebookTracker,
    settingRegistry: ISettingRegistry) => {
      console.log('JupyterLab extension activating')
      // <snip>

but then tsc complains that

src/index.ts:214:49 - error TS2322: Type 'Token<ISettingRegistry>' is not assignable to type 'Token<any>'.
  Types have separate declarations of a private property '_tokenStructuralPropertyT'.

214   requires: [ICommandPalette, INotebookTracker, ISettingRegistry],

Not sure if that’s because of an error of mine - most likely - or something with jlab4 though

Does this ring any bell to anyone ?

Any hint welcome :slight_smile:

Apologies, problem solved

turns out that while following the guidelines I did

jlpm add @jupyterlab/settingregistry

which added in my package.json

    "@jupyterlab/settingregistry": "^3.6.3",

which was wrong of course, and bumping to

    "@jupyterlab/settingregistry": "^4.0.0-beta.2",

fixed the problem

For future reference Types have separate declarations of is usually a strong indication of version mismatch. It can happen by version mis-specification (as here) or when upgrading some packages but not others. In worst case scenario (when there is no mis-specification) one needs to remove node_packages and run jlpm afresh to recreate it.