Skip to content

instanceof appears to be broken #138

@robross0606

Description

@robross0606

Tried using this with @kubernetes/client-node and it failed at syncInclude() call:

const importSync = require('import-sync')
const k8s = importSync('@kubernetes/client-node')

Yielded:

    Failed to import from:
      @kubernetes/client-node
    Options:
      {}
    Require error message:
      YAMLException: Specified list of YAML types (or a single Type object) contains a non-Type object.
      at node_modules/js-yaml/lib/schema.js:104:13
          at Array.forEach (<anonymous>)
      at Schema.extend (node_modules/js-yaml/lib/schema.js:102:12)
      at new Schema (node_modules/js-yaml/lib/schema.js:62:15)
      at Object.<anonymous> (node_modules/js-yaml/lib/schema/failsafe.js:11:18)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:279304)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:315535)
      at Object.<anonymous>.require.Module._extensions (node_modules/@httptoolkit/esm/esm.js:1:163)
      at Object.Cp (node_modules/@httptoolkit/esm/esm.js:1:314277)
      at p (node_modules/@httptoolkit/esm/esm.js:1:315579)
      at cl (node_modules/@httptoolkit/esm/esm.js:1:275662)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:316224)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:257086)
      at Object.<anonymous>.require.Module._extensions (node_modules/@httptoolkit/esm/esm.js:1:163)
      at Object.Cp (node_modules/@httptoolkit/esm/esm.js:1:314277)
      at Object.u (node_modules/@httptoolkit/esm/esm.js:1:316406)
      at Object.o (node_modules/@httptoolkit/esm/esm.js:1:315227)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:312984)
      at Object.apply (node_modules/@httptoolkit/esm/esm.js:1:228557)
      at node_modules/@httptoolkit/esm/esm.js:1:279876
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:279918)
      at node_modules/@httptoolkit/esm/esm.js:1:282340
      at node_modules/@httptoolkit/esm/esm.js:1:282416
      at vu (node_modules/@httptoolkit/esm/esm.js:1:257110)
      at Proxy.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:282190)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:280271)
      at Object.t (node_modules/@httptoolkit/esm/esm.js:1:307870)
      at n (node_modules/@httptoolkit/esm/esm.js:1:307684)
      at Object.<anonymous> (node_modules/js-yaml/lib/schema/json.js:12:18)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:279304)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:315535)
      at Object.<anonymous>.require.Module._extensions (node_modules/@httptoolkit/esm/esm.js:1:163)
      at Object.Cp (node_modules/@httptoolkit/esm/esm.js:1:314277)
      at p (node_modules/@httptoolkit/esm/esm.js:1:315579)
      at cl (node_modules/@httptoolkit/esm/esm.js:1:275662)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:316224)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:257086)
      at Object.<anonymous>.require.Module._extensions (node_modules/@httptoolkit/esm/esm.js:1:163)
      at Object.Cp (node_modules/@httptoolkit/esm/esm.js:1:314277)
      at Object.u (node_modules/@httptoolkit/esm/esm.js:1:316406)
      at Object.o (node_modules/@httptoolkit/esm/esm.js:1:315227)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:312984)
      at Object.apply (node_modules/@httptoolkit/esm/esm.js:1:228557)
      at node_modules/@httptoolkit/esm/esm.js:1:279876
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:279918)
      at node_modules/@httptoolkit/esm/esm.js:1:282340
      at node_modules/@httptoolkit/esm/esm.js:1:282416
      at vu (node_modules/@httptoolkit/esm/esm.js:1:257110)
      at Proxy.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:282190)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:280271)
      at Object.t (node_modules/@httptoolkit/esm/esm.js:1:307870)
      at n (node_modules/@httptoolkit/esm/esm.js:1:307684)
      at Object.<anonymous> (node_modules/js-yaml/lib/schema/core.js:11:18)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:279304)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:315535)
      at Object.<anonymous>.require.Module._extensions (node_modules/@httptoolkit/esm/esm.js:1:163)
      at Object.Cp (node_modules/@httptoolkit/esm/esm.js:1:314277)
      at p (node_modules/@httptoolkit/esm/esm.js:1:315579)
      at cl (node_modules/@httptoolkit/esm/esm.js:1:275662)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:316224)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:257086)
      at Object.<anonymous>.require.Module._extensions (node_modules/@httptoolkit/esm/esm.js:1:163)
      at Object.Cp (node_modules/@httptoolkit/esm/esm.js:1:314277)
      at Object.u (node_modules/@httptoolkit/esm/esm.js:1:316406)
      at Object.o (node_modules/@httptoolkit/esm/esm.js:1:315227)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:312984)
      at Object.apply (node_modules/@httptoolkit/esm/esm.js:1:228557)
      at node_modules/@httptoolkit/esm/esm.js:1:279876
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:279918)
      at node_modules/@httptoolkit/esm/esm.js:1:282340
      at node_modules/@httptoolkit/esm/esm.js:1:282416
      at vu (node_modules/@httptoolkit/esm/esm.js:1:257110)
      at Proxy.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:282190)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:280271)
      at Object.t (node_modules/@httptoolkit/esm/esm.js:1:307870)
      at n (node_modules/@httptoolkit/esm/esm.js:1:307684)
      at Object.<anonymous> (node_modules/js-yaml/lib/schema/default.js:11:18)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:279304)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:315535)
      at Object.<anonymous>.require.Module._extensions (node_modules/@httptoolkit/esm/esm.js:1:163)
      at Object.Cp (node_modules/@httptoolkit/esm/esm.js:1:314277)
      at p (node_modules/@httptoolkit/esm/esm.js:1:315579)
      at cl (node_modules/@httptoolkit/esm/esm.js:1:275662)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:316224)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:257086)
      at Object.<anonymous>.require.Module._extensions (node_modules/@httptoolkit/esm/esm.js:1:163)
      at Object.Cp (node_modules/@httptoolkit/esm/esm.js:1:314277)
      at Object.u (node_modules/@httptoolkit/esm/esm.js:1:316406)
      at Object.o (node_modules/@httptoolkit/esm/esm.js:1:315227)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:312984)
      at Object.apply (node_modules/@httptoolkit/esm/esm.js:1:228557)
      at node_modules/@httptoolkit/esm/esm.js:1:279876
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:279918)
      at node_modules/@httptoolkit/esm/esm.js:1:282340
      at node_modules/@httptoolkit/esm/esm.js:1:282416
      at vu (node_modules/@httptoolkit/esm/esm.js:1:257110)
      at Proxy.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:282190)
      at Object.<anonymous> (node_modules/@httptoolkit/esm/esm.js:1:280271)
      at Object.t (node_modules/@httptoolkit/esm/esm.js:1:307870)
      at n (node_modules/@httptoolkit/esm/esm.js:1:307684)

      at esmImport (node_modules/import-sync/src/import.ts:18:11)
      at importSync (node_modules/import-sync/src/import.ts:40:26)
      at Object.importSync (src/k8s/kubernetesClient.js:5:13)
      at Object.require (src/k8s/documents.js:5:16)
      at Object.require (src/metadataClient.js:4:64)
      at Object.require (src/__tests__/metadataTest.js:6:24)

As far as I can tell from debug mode, type instanceof Type is resolving to false down inside a transient dependency js-yaml:

Image

Image

It is unclear why this might be the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions