Troubleshooting Typesense Errors in NestJS Project
TLDR Iulian is experiencing Typesense errors in a NestJS project. Kishore Nallan and Jason provide advice, suggesting try-catch and looking at code snippets respectively.
1
Nov 26, 2021 (26 months ago)
Iulian
10:57 AMmain | /app/node_modules/typesense/lib/Typesense/Typesense/ApiCall.js:261
main | const customErrror = new CustomErrorKlass(errorMessage)
main | ^
main | Error: Request failed with HTTP code 400 | Server said: Field
stationId has been declared in the schema, but is not found in the document.
main | at ApiCall._customErrorForResponse (/app/node_modules/typesense/lib/Typesense/Typesense/ApiCall.js:261:26)
main | at ApiCall._callee$ (/app/node_modules/typesense/lib/Typesense/Typesense/ApiCall.js:137:38)
main | at tryCatch (/app/node_modules/regenerator-runtime/runtime.js:63:40)
main | at Generator.invoke [as _invoke] (/app/node_modules/regenerator-runtime/runtime.js:294:22)
main | at Generator.next (/app/node_modules/regenerator-runtime/runtime.js:119:21)
main | at asyncGeneratorStep (/app/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
main | at _next (/app/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
Kishore Nallan
11:04 AMAs for the actual reason for this error, a document without the stationId field is being attempted to be added.
Jason
05:47 PMDec 16, 2021 (25 months ago)
Iulian
06:38 PMcreatePost(data: TypeSensePost) {
try {
typeSenseClient.collections('posts').documents().create(data);
} catch (error) {
console.log(error);
}
}
1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Typescript Support and Import Issues with Typesense
Ahmad faced trouble with Typesense support for Typescript. Jason assisted by suggesting checks and solutions. Phil suggested modifying the import statement. Ultimately, the issue was resolved with a change from Jason in version `v1.1.2`.
Typesense Error in Unit Testing for Python
Mehdi was encountering errors while running unit tests for Typesense functionalities in Python. Through discussion with Kishore Nallan, they recognized resource constraints might be causing the issue during JSONL file import. As suggested by Kishore Nallan, adding a short sleep after the import resolved the problem.
Troubleshooting TypeScript Error with Typesense
GM experienced an error with Typesense in TypeScript, requiring help to correct the issues. Jason helped propose solutions and adjustments to the code. Ultimately, they were able to resolve the errors and successfully implement a search function.