on 10-22-2020 2:40 AM
Hi everybody,
I´m getting this error when i execute a view with parameters in CAP, this was fine before CAP september 2020 release. This is the error:
GET /bacrcr003/CatalogoCaracteristica(codigoMarca='',codigoModelo='',annoModelo='',caracteristica='SCP_MARCA')/Set
[2020-10-22T01:12:54.548Z | ERROR | 1642953]: name.replace is not a function
[2020-10-22T01:12:54.549Z | ERROR | 1642953]: Error stacktrace: TypeError: name.replace is not a function at ensureNoDraftsSuffix (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/common/utils/draft.js:35:43) at getEntityFromCQN (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/common/utils/entityFromCqn.js:40:30) at HanaDatabase.transformToArrayed [as _arrayed] (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/db/generic/arrayed.js:43:18) at /Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds/lib/srv/Service.js:102:54 at Array.map (<anonymous>) at HanaDatabase.dispatch (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds/lib/srv/Service.js:102:28) at async ApplicationService.<anonymous> (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/common/generic/crud.js:43:16) at async next (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds/lib/srv/Service.js:90:34) at async ApplicationService.dispatch (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds/lib/srv/Service.js:86:26) at async _readCollectionNoCount (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/cds-services/adapter/odata-v4/handlers/read.js:261:18)
[INTERNAL ERROR] TypeError: name.replace is not a function
at ensureNoDraftsSuffix (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/common/utils/draft.js:35:43)
at getEntityFromCQN (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/common/utils/entityFromCqn.js:40:30)
at HanaDatabase.transformToArrayed [as _arrayed] (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/db/generic/arrayed.js:43:18)
at /Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds/lib/srv/Service.js:102:54
at Array.map (<anonymous>)
at HanaDatabase.dispatch (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds/lib/srv/Service.js:102:28)
at async ApplicationService.<anonymous> (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/common/generic/crud.js:43:16)
at async next (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds/lib/srv/Service.js:90:34)
at async ApplicationService.dispatch (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds/lib/srv/Service.js:86:26)
at async _readCollectionNoCount (/Users/luisgleon/Downloads/Development/ZAPATA/dms4100-bacrcr003/node_modules/@sap/cds-runtime/lib/cds-services/adapter/odata-v4/handlers/read.js:261:18)
Please report this error.
my package.json libraries:
"@sap/cds": "4.2.4",
"@sap/cds-odata-v2-adapter-proxy": "1.4.49",
"@sap/cds-runtime": "2.5.5",
"@sap/cloud-sdk-core": "1.17.2",
"@sap/hana-client": "2.6.58",
"@sap/xsenv": "3.0.0",
"@sap/xssec": "3.0.10",
I had to dowgrade this two packages to make it work again:
"@sap/cds": "4.1.9",
"@sap/cds-runtime": "2.3.1",
Finally, this is my view in cds file.
view CatalogoCaracteristica(codigoMarca : String, codigoModelo : String, annoModelo : String, caracteristica : String) as
select from Caracteristicas
left join Alternativas
on Caracteristicas.ID = caracteristica.ID
{
key Alternativas.ID,
marca,
modelo,
anno,
codigo,
valor,
Alternativas.descripcion
}
where
marca = : codigoMarca
and modelo = : codigoModelo
and anno = : annoModelo
and codigo = : caracteristica
order by
valor asc;
Thanks in advance.
Hi Luis,
the fix for this problem was released. Of course please let us know if you still face issues.
Best regards,
Heiko
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
still having the same issue with cds-pg and the latest engine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
that's most certainly because we haven't yet upgdated cds-pg to support cds^6
please try downgrading cds to cds^5
→ talks are on the way with the CAP core team on how to best co-maintain cds-pg in the future
Thank you
Looks like the original issue is that cds-routing-handlers is not compatible with 6.x
More precisely, it works but if you throw an exception it dies, if I remember correctly with a similar error. Happens without postgres interactions too.
Will open an issue there now that I think about it, but will stay on 5.x for the time being
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.