cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDS Watch fails with folder watch error after a while in SAP Build Code (BAS)

StefanSchorn
Explorer
3,057

Hey team,

When using SAP Build Code in my trial, I am working on a Full Stack Application (CAPire App). Using the generated Run configuration, everything runs fine, but after a while (few seconds to few minutes) an error occurs which kills the run stack. I feel ther is a bug as the '.git' folder should never be watched.

Help is appriciated.

[cds] - my watch has ended.  
watch.js:121
Process exited with code 1

Uncaught Error Error: ENOENT: no such file or directory, stat '/home/user/projects/supernewaiapp/.git/objects/maintenance.lock'
    at statSync (node:fs:1659:25)
    at <anonymous> (node:internal/fs/recursive_watch:160:28)
    at emit (node:events:518:28)
    at FSWatcher._handle.onchange (node:internal/fs/watchers:215:12)
    at callbackTrampoline (node:internal/async_hooks:130:17)
    --- FSEVENTWRAP ---
    at init (node:internal/inspector_async_hook:25:19)
    at emitInitNative (node:internal/async_hooks:202:43)
    at FSWatcher (node:internal/fs/watchers:193:18)
    at watch (node:fs:2463:15)
    at #watchFile (node:internal/fs/recursive_watch:156:21)
    at #watchFolder (node:internal/fs/recursive_watch:129:26)
    at <anonymous> (node:internal/fs/recursive_watch:179:26)
    at emit (node:events:518:28)
    at FSWatcher._handle.onchange (node:internal/fs/watchers:215:12)
    at callbackTrampoline (node:internal/async_hooks:130:17)

 

Accepted Solutions (1)

Accepted Solutions (1)

PeterRoehlen
Participant

I was getting the exact same thing developing CAP projects in a VS Code dev container. The thing that seemed to fix it for me was switching from Node 22 to Node 20. I don't know if that's an option for you.

Edit: The node version can be changed in BAS dev spaces using this guide:

https://community.sap.com/t5/technology-blogs-by-sap/managing-runtime-versions-in-sap-business-appli...

StefanSchorn
Explorer
0 Likes

Hi Peter,

for my local dev enviorement in VSC, without BAS respectivly SAP Build Code, I am even using Node 18.20 which seems to be the valid supported Version for CAPire (lts/hydrogen). Whith this version I have to issues at all. I investigated a little, but I could not found an official way to downgrade Node.js in the BAS Container, only manually installation of NVM in the container was described in the community, but thats a workaround.
So I think it is correct what you are saying, because also the CAPire sec plugins complain about the unsupported high node.js version. Only I do not understand how to change this in a supported way in BAS.

 

user: supernewaiapp $ npm i
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@sap/xsenv@3.4.0',
npm WARN EBADENGINE   required: { node: '^10.0.0 || ^12.0.0 || ^14.0.0 || ^16.0.0 || ^18.0.0' },
npm WARN EBADENGINE   current: { node: 'v20.12.0', npm: '10.5.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@sap/xsenv@3.3.2',
npm WARN EBADENGINE   required: { node: '^10.0.0 || ^12.0.0 || ^14.0.0 || ^16.0.0' },
npm WARN EBADENGINE   current: { node: 'v20.12.0', npm: '10.5.0' }
npm WARN EBADENGINE }

up to date, audited 812 packages in 5s

99 packages are looking for funding
  run `npm fund` for details

5 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

 

 

PeterRoehlen
Participant

Hi Stephan,

I've been able to change the node version in my BAS dev spaces using this guide:

https://community.sap.com/t5/technology-blogs-by-sap/managing-runtime-versions-in-sap-business-appli...

I think it's probably using something like NVM behind the scenes, but I balked at doing it that way myself after seeing the article you mentioned and thankfully found SAP had added a feature to do it via a command.

StefanSchorn
Explorer
Great I'll try that

Answers (0)