fiori-elements-incident-management icon indicating copy to clipboard operation
fiori-elements-incident-management copied to clipboard

TypeError: DEBUG is not a function

Open ManuelB opened this issue 1 year ago • 2 comments

Use the current version of SAP Business Application Studio based on the following tutorial: https://developers.sap.com/tutorials/fiori-tools-cap-create-application.html

$ npm run watch

> [email protected] watch
> npx cds watch

(node:3082) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3082) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
[INTERNAL ERROR] TypeError: DEBUG is not a function
    at Server.listening (/home/user/.node_modules_global/lib/node_modules/@sap/cds-dk/lib/watch/livereload-server.js:24:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Please report this error.

It seams that the following code returns undefined:

const DEBUG = cds.debug('cli|watch|livereload')

ManuelB avatar Apr 12 '23 15:04 ManuelB

As a workaround the following command starts the system:

DEBUG=all cds watch

ManuelB avatar Apr 12 '23 15:04 ManuelB

I had another issue: [cds] - @sap/cds 4.6.6 loaded: /home/user/fiori-elements-incident-management/node_modules/@sap/cds [cds] - Command resolved: /home/user/.node_modules_global/lib/node_modules/@sap/cds-dk/bin/watch.js /home/user/fiori-elements-incident-management/node_modules/@sap/cds/lib/env/index.js:257 o = o[next] || (o[next] = {}) ^

TypeError: Cannot read properties of null (reading 'watch')

This was solved by using the newest cds version in package.json

ghost avatar Jul 07 '23 07:07 ghost