Skip to content

[Critical Bug] Changes to JSONObject in coreutils@1.5.1 are breaking jupyterlab extension builds #83

Closed
@telamonian

Description

@telamonian

If I try to build the latest master of jupyter-fs:

git clone git@github.com:jpmorganchase/jupyter-fs.git
cd jupyter-fs
make js

I get the following error on the tsc (ie typescript compilation) step:

$ tsc
../node_modules/@jupyterlab/observables/lib/modeldb.d.ts:227:9 - error TS2416: Property 'changed' in type 'ObservableValue' is not assignable to the same property in base type 'IObservableValue'.
  Type 'ISignal<this, IChangedArgs>' is not assignable to type 'ISignal<IObservableValue, IChangedArgs>'.
    Type 'this' is not assignable to type 'IObservableValue'.
      Type 'ObservableValue' is not assignable to type 'IObservableValue'.
        The types returned by 'get()' are incompatible between these types.
          Type 'JSONValue' is not assignable to type 'PartialJSONValue'.
            Type 'JSONObject' is not assignable to type 'PartialJSONValue'.
              Type 'JSONObject' is not assignable to type 'string'.

227     get changed(): ISignal<this, ObservableValue.IChangedArgs>;
            ~~~~~~~

../node_modules/@jupyterlab/observables/lib/modeldb.d.ts:231:5 - error TS2416: Property 'get' in type 'ObservableValue' is not assignable to the same property in base type 'IObservableValue'.
  Type '() => JSONValue' is not assignable to type '() => PartialJSONValue'.

231     get(): JSONValue;
        ~~~


Found 2 errors.

This is definitely being caused by the latest release of @lumino/coreutils, since if I add a resolution to the previous coreutils to my package.json:

    "resolutions": {
        "@lumino/coreutils": "1.5.0"
    }

the build error is fixed.

I beleive the underlying cause is the redefintion of JSONObject that was part of the 1.5.1 release.

@lumino/coreutils@1.5.0:

/**
* A type definition for a JSON object.
*/
export
interface JSONObject { [key: string]: JSONValue; }

@lumino/coreutils@1.5.1:

/**
* A type definition for a JSON object.
*/
export
interface JSONObject { [key: string]: JSONValue | ReadonlyJSONValue; }

Because this was a patch release of coretuils (1.5.0 => 1.5.1), you'll likely only see the bug if you delete your yarn.lock (or if start from a fresh build that never had one).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions