2024 Jul 16 4:08 PM - edited 2024 Jul 16 4:10 PM
Hi everyone,
I recently faced a challenge in my CAP project using Node.js. I defined some entities, and one of them lacked a primary key. When I ran mbt build, I encountered this error:
"This application uses @sap/cds version 6.8, which is not compatible with the installed @sap/cds-dk version 8. You can either:
- Update @sap/cds to the latest version (recommended)
- Downgrade @sap/cds-dk to version 7."
Following the recommendation, I upgraded @Sisn/cds to the latest stable version (8.0.3). However, after running mbt build again, I received a new error:
[ERROR] Expected entity to have a primary key (in entity: xxxx)
This behavior surprised me because I couldn't find any documentation explicitly mentioning mandatory primary keys for CAP projects, especially since it worked with previous @Sisn/cds versions. While I understand the importance of primary keys as good practice, I wanted to clarify if this requirement is officially documented and where to find updates on @Sisn/cds version changes.
If you've encountered a similar situation or have insights on primary key requirements in CAP projects, please share your thoughts in the comments below!
Thank you in advance!
You can find it here in the release notes of CDS 8: https://cap.cloud.sap/docs/releases/jun24#odata-entities-must-have-a-key
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.