next.js:41 Uncaught (in promise) Error: Invalid predicate. Terminate your predicate with a valid condition (e.g., `p => p.field.eq('value')`) or pass `Predicates.ALL`.
at internals (next.js:41:1)
at DataStore.<anonymous> (datastore.js:2178:66)
at step (tslib.es6.js:100:1)
at Object.next (tslib.es6.js:81:45)
at fulfilled (tslib.es6.js:71:42)
The problem is that it's impossible to know where the error is when we have over 1 million lines in an app. The error message is too generic and could relate to any line in a DataStore query. It would be much easier to fix if I could know where or which predicate has the error, rather than just showing me an example of how to write a correct predicate.
I tried looking into tslibs.es6.js and next.js to catch the error, but the changes to the file weren't applied on localhost, so I still have the issue nevertheless it will be great if in the future we could have a better description to find the issue.
Expected behavior
export var internals = function (key) {
if (!predicateInternalsMap.has(key)) {
throw new Error(`Invalid predicate: ${currentInvalidPredicate} Terminate your predicate with a valid condition.`);
}
return predicateInternalsMap.get(key);
};
Reproduction steps
To reproduce the issue just use an invalid predicate into a query.
Before opening, please confirm:
JavaScript Framework
Vue
Amplify APIs
DataStore
Amplify Version
v5
Amplify Categories
storage
Backend
Amplify CLI
Environment information
Describe the bug
Recently I got an issue that told me:
The problem is that it's impossible to know where the error is when we have over 1 million lines in an app. The error message is too generic and could relate to any line in a DataStore query. It would be much easier to fix if I could know where or which predicate has the error, rather than just showing me an example of how to write a correct predicate.
I tried looking into
tslibs.es6.js
andnext.js
to catch the error, but the changes to the file weren't applied on localhost, so I still have the issue nevertheless it will be great if in the future we could have a better description to find the issue.Expected behavior
Reproduction steps
To reproduce the issue just use an invalid predicate into a query.
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots