on 02-28-2023 11:39 PM
Hello,
I get the error Path title leads to element. The path should lead to type Edm.PrimitiveType.CDS (annotations) . It happens 9 times for every $Type : and value pair.
The strange thing is even with the error I still see Fiori preview rendering Risks correctly. However, Mitigations and BusinessPartners do not show anything on Fiori preview.
The following is my annotations.cds which is copied from the course content.
// using RiskService as service from '../../srv/risk-service';using RiskService from '../../srv/risk-service'; // Risk List Report Page annotate RiskService.Risks with @(UI : { HeaderInfo : { TypeName : 'Risk', TypeNamePlural : 'Risks', Title : { $Type : 'UI.DataField', Value : title, }, Description : { $Type : 'UI.DataField', Value : descr, } }, SelectionFields : [prio], Identification : [{Value : title}], // Define the table columns LineItem : [ {Value : title}, {Value : miti_ID}, {Value : owner}, {Value : bp_BusinessPartner}, { Value : prio, Criticality : criticality }, { Value : impact, Criticality : criticality }, ], }); // Risk Object Page annotate RiskService.Risks with @(UI : { Facets : [{ $Type : 'UI.ReferenceFacet', Label : 'Main', Target : '@UI.FieldGroup#Main', }], FieldGroup #Main : {Data : [ {Value : miti_ID}, {Value : owner}, {Value : bp_BusinessPartner}, { Value : prio, Criticality : criticality }, { Value : impact, Criticality : criticality } ]}, });In my Company, we have had this exact Issue. This is
how you can fix it
1. Update the following package: npm install
@sap/ux-cds-odata-language-server-extension
2. Delete the "SAP CDS Language Support" extension.
3. Close VS Code
4. in the Folder "C:\User\<User>\.vscode\extensions" delete the subfolder "sapse.vscode-cds-<version>"
5. Start VS Code and Install the Extension again.
This has resolved the issue for me and my colleagues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Leila,
the issue is due to changes in recent version of `@sap/cds-compiler` (presumably 3.7.2).
Validation of annotations is done in a separate npm module `@sap/ux-cds-odata-language-server-extension`. This module reacts to these changes in its next version (1.9.2) which should be available on npmjs.org in a few days.
It should be picked up from there automatically by the IDE (VSCode or BAS)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi maryana.naboka,
I am still facing the issue after restarting VSCode. Can You please tell, how I can fetch the updated modules mentioned above so that wrong syntax checks disappear ? I checked for updates in VScode also and disabled any CDS related 3rd part extensions.
I've deleted my node_modules folder and package-lock.json in the project root, then reinstalled node modules. However the situation is still the same.
I've the below version in my workspace, should I Increase here something ?
├── @sap_oss/alert-notification-client@1.6.0
├── @sap-cloud-sdk/http-client@3.0.1
├── @sap/audit-logging@5.7.0
├── @sap/cds-dk@6.6.1
├── @sap/cds-mtxs@1.6.3
├── @sap/cds-odata-v2-adapter-proxy@1.9.20
├── @sap/cds@6.6.1
├── @sap/ux-specification@1.108.0
├── @sap/xsenv@3.4.0
├── @sap/xssec@3.2.17
├── axios@0.27.2
├── cds-swagger-ui-express@0.5.0
├── cf-nodejs-logging-support@6.14.1
├── cfenv@1.2.4
├── chai-as-promised@7.1.1
├── chai-subset@1.6.0
├── chai@4.3.7
├── debug@4.3.4
├── express@4.18.2
├── hdb@0.19.5
├── jest@29.5.0
├── node-fetch@2.6.9
├── node-jose@2.2.0
├── passport@0.6.0
└── sqlite3@5.1.6
Thank You in advance
Best regards
Attila
Hi Uwe Schwerk
I'm facing the same problems now. However, the error msg only appears in a few repos. I wonder if there were anything I coded by mistake but I can't find out what's the difference between my and others' repos.
Best regards,
Yijun
attila.berencsi
yijun.lin
In rare cases it is possible that the old version of the node module is cached and used instead of the new one.
In this case you can do the following:
1. Uninstall the SAP CDS Language Support extension
2. Delete the folder for this extension (e.g. sapse.vscode-cds-6.6.0) from the vscode extensions folder (e.g. /Users/<your user>/.vscode/extensions/)
3. Install the SAP CDS Language Support extension again
If you like, you can check which module version is used in your vscode. For that, please check the second line in the following file: /Users/<your user>/.vscode/extensions/sapse.vscode-cds-6.6.0/node_modules/@sap/cds-lsp/contributions/blue/node_modules/@sap/ux-cds-odata-language-server-extension/package.json
or
/Users/<your user>/.vscode/extensions/sapse.vscode-cds-6.6.0/node_modules/@sap/cds-lsp/contributions/green/node_modules/@sap/ux-cds-odata-language-server-extension
It should show "version": "1.9.2",
*using blue or green depends on the value set in file /Users/<your user>/.vscode/extensions/sapse.vscode-cds-6.6.0/node_modules/@sap/cds-lsp/contributions/active
Thanks, Mariana. Removing the extension and its folder worked for me.
Works for me too. Thanks, Mariana.
Hi Mariana,
Thank You, it works! Seeing now red underline I can be sure that I did a mistake 🙂
Best regards, Attila
User | Count |
---|---|
69 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.