Closed C5295836 closed 2 months ago
which @cap-js/db-service
version are you using? I can see your @cap-js/sqlite
version is quite old. Please update all your dependencies. If the issue persists, provide a sample project (or your project) with detailed steps to reproduce your scenario.
We updated to latest version and issue is gone. Thanks!
hm. Error message is gone, however entity isn't created. Something still go wrong on "await next()", because next handler is not reached :
this.after("SAVE", [LandscapeAssignmentMembers, LandscapeAssignmentMembers.drafts], async (laMember) => { ... } );
Glad your initial problem is solved :)
I can't help you with your follow up problem though. Does not seem to be related to the database services. Please consult the documentation or report an internal issue in the cap/issues
repository.
"@cap-js/sqlite": "^1.5.0", "@sap/cds": "^7.9.0", "@sap/cds-dk": "^7.9.5", "sqlite3": "^5.0.4" node version v20.13.1
Error message: "TypeError: Cannot read properties of undefined (reading '$now')"
Data model:
Code:
Error "TypeError: Cannot read properties of undefined (reading '$now')" happens on await next(); of 'SAVE' handler: this.on( "SAVE", [LandscapeAssignmentMembers, LandscapeAssignmentMembers.drafts], async (req, next) => { ... await next(); } );