Skip to content

[USING Keyv] TypeError: Right-hand side of 'instanceof' is not callable #20

@DerekWolfie

Description

@DerekWolfie

I found an error on version v2 (vrchat@next) [1.19.4-next.1750173540]

https://github.com/vrchatapi/vrchatapi-javascript/tree/v2

When using the Keyv adapter
This is my VRChat class instance

this.vrchat = new VRChat({
    application: {
      name: `MyApp`,
      version: "1.0.0",
      contact: "[email protected]"
    },
    throwOnError: true,
    keyv: new KeyvFile({ filename: `./cookies.json` })
  },
);

This is the part of the code that might be causing the error
https://github.com/vrchatapi/vrchatapi-javascript/blob/v2/src/client.ts#L144

this.cache = new Cacheable({
	nonBlocking: true,
	secondary:
		keyv
			? keyv instanceof Keyv
				? keyv
				: new Keyv({
					store: keyv
				})
			: undefined
});

This is the console output:

TypeError: Right-hand side of 'instanceof' is not callable
vfm-api:dev:     at new D (J:\Projetos\vfm-apps-monorepo\node_modules\vrchat\src\client.ts:119:8)
...

yarn -v

4.9.2

node -v

v22.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions