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

Error "Cannot read properties of undefined (reading 'split')" #122

Open
D027152 opened this issue Sep 30, 2024 · 0 comments
Open

Error "Cannot read properties of undefined (reading 'split')" #122

D027152 opened this issue Sep 30, 2024 · 0 comments

Comments

@D027152
Copy link

D027152 commented Sep 30, 2024

Hello colleagues

We upgrade to"@sap/cds": "8.x.x" from "@sap/cds": "7.x.x", and face the following problem.

We have an entity that has a property that is typed as DateTime or Timestamp (in the cds model).
We insert a instance into the entity with INSERT.into ...
In javascript / typescript, the property is of type Date (not: string).

Before the upgrade this worked.
After the upgrade we get in node_modules/@cap-js/change-tracking/lib/change-log.js:177:44 the error
"Cannot read properties of undefined (reading 'split')" See also the screenshot from my local environment:

image

When we instead do the INSERT statement with the property being a string instead of Date, we don't get this error.

The CAP runtime seems to accept the type Date. Therefore, our expectation is that also change tracking should accept Date.

To reconstruct:

  • repo https://github.tools.sap/erp4sme/crypto-for-business
  • branch new_cds
  • npm ci
  • run unit test "01. Add an entry to the BusinessPartners entity -> this should be selected properly" in file lib/masterData/businessPartners/DbBusinessPartnerRepository.ts; this results in the above-mentioned error

Can you please check and advise.

Thank you and best regards,
Stefan

We use CAP with NodeJs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant