Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model default scope with inq causes TypeError: Right-hand side of 'instanceof' is not callable #1894

Open
ewrayjohnson opened this issue Jun 28, 2021 · 0 comments
Labels

Comments

@ewrayjohnson
Copy link

ewrayjohnson commented Jun 28, 2021

Steps to reproduce

  1. Create a model including a property like:
  "properties" : {
    ....
    "list": {
        "type": ["string"],
        "index": true
      }
      ...
  }
  1. Add "scope" to the model like:
  "scope": {
    "where": {
      "list": {
        "inq": ["1", "2"]
      }
    }
  }
  1. Add data which satisfies the scope. For example the values of list = ["2"]
  2. Do a simple GET on the model via the REST API.

Current Behavior

Exception thrown is: "TypeError: Right-hand side of 'instanceof' is not callable" in loopback-datasource-juggler\lib\utils.js on or about line 67. The offending code is this clause:
val instanceof prop.type

Expected Behavior

No exception thrown and the data returned.

Link to reproduction sandbox

reproduction sandbox forthcoming

Additional information

If I put a try catch around the offending statement, everything works as expected.

win32 x64 12.18.3

+-- @loopback/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]

Related Issues

@stale stale bot added the stale label Aug 27, 2021
@achrinza achrinza removed the stale label Aug 27, 2021
@loopbackio loopbackio deleted a comment from stale bot Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants