You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello team,
I am trying to integrate WS with my project and getting the following error when i try to connect.
[CDS] [cds|t1] - ❗️Uncaught TypeError: Cannot read properties of undefined (reading 'startsWith')
[CDS] at cds_context_model (/Users/shashwatjain/Repos/mymediset_cloud/node_modules/@sap/cds/lib/srv/middlewares/ctx-model.js:9:21)
[CDS] at /Users/shashwatjain/Repos/mymediset_cloud/node_modules/@cap-js-community/websocket/src/socket/base.js:237:16
[CDS] at call (/Users/shashwatjain/Repos/mymediset_cloud/node_modules/@cap-js-community/websocket/src/socket/ws.js:295:9)
[CDS] at /Users/shashwatjain/Repos/mymediset_cloud/node_modules/@cap-js-community/websocket/src/socket/ws.js:299:13
[CDS] at wrapNext (/Users/shashwatjain/Repos/mymediset_cloud/node_modules/@cap-js-community/websocket/src/socket/base.js:233:13)
[CDS] at basic_auth (/Users/shashwatjain/Repos/mymediset_cloud/node_modules/@sap/cds/lib/srv/middlewares/auth/basic-auth.js:26:5)
[CDS] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
After inspection i can see that req coming in from WS does not have a base url property:
module.exports=()=>{constcds=require('../../index'),LOG=cds.log()constcontext_model_required=cds.requires.extensibility||cds.requires.togglesif(!context_model_required)return[]const{ model4 }=require('../srv-models')returnasyncfunctioncds_context_model(req,res,next){if(req.baseUrl.startsWith('/-/'))returnnext()//> our own tech services cannot be extended ///<<<<<FAILS HEREconstctx=cds.contextif(ctx.tenant||ctx.features?.given)try{ctx.model=req.__model=awaitmodel4(ctx.tenant,ctx.features)// REVISIT: req.__model is because of Okra}catch(e){LOG.error(e)returnres.status(503).json({// REVISIT: we should throw a simple error, nothing else! -> this is overly OData-specific!error: {code: '503',message:
process.env.NODE_ENV==='production' ? 'Service Unavailable' :
'Unable to get context-specific model due to: '+e.message}})}next()}}
Toggles is turned on in the project.
The text was updated successfully, but these errors were encountered:
Hello team,
I am trying to integrate WS with my project and getting the following error when i try to connect.
After inspection i can see that
req
coming in from WS does not have a base url property:Toggles is turned on in the project.
The text was updated successfully, but these errors were encountered: