SAP-samples / fiori-elements-incident-management

This repository contains the sample OData V4 service material for the tutorials provided in the SAP Developer Center.
Apache License 2.0
32 stars 29 forks source link

TypeError: DEBUG is not a function #11

Open ManuelB opened 1 year ago

ManuelB commented 1 year ago

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

> fiori_elements_tutorial@1.0.0 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 commented 1 year ago

As a workaround the following command starts the system:

DEBUG=all cds watch
ghost commented 1 year ago

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