cds-dbm icon indicating copy to clipboard operation
cds-dbm copied to clipboard

Build fails when using @sap/cds 5.3.x - Error message: Cannot read property 'features' of undefined

Open gregorwolf opened this issue 3 years ago • 3 comments

Hi @mikezaschka,

you might have seen that cds-pg was just upgraded to support @sap/cds 5.3.x. Unfortunately when using this @sap/cds version the command cds-dbm build --production fails with this output:

cds-dbm build

Generates build artifacts

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

TypeError: Cannot read property 'features' of undefined
    at Object.exports.handler (/Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/dist/cli/build.js:54:15)
    at /Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/node_modules/yargs/build/index.cjs:1:8973
    at j (/Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/node_modules/yargs/build/index.cjs:1:4852)
    at _.applyMiddlewareAndGetResult (/Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/node_modules/yargs/build/index.cjs:1:8942)
    at _.runCommand (/Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/node_modules/yargs/build/index.cjs:1:7127)
    at Bt.[runYargsParserAndExecuteCommands] (/Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/node_modules/yargs/build/index.cjs:1:52416)
    at Bt.parse (/Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/node_modules/yargs/build/index.cjs:1:36100)
    at Bt.get [as argv] (/Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/node_modules/yargs/build/index.cjs:1:55639)
    at Object.<anonymous> (/Users/gwolf/Documents/Projects/cap/pg-beershop/node_modules/cds-dbm/dist/cli.js:2:53)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)

Best regards Gregor

gregorwolf avatar Aug 03 '21 05:08 gregorwolf

I've created the branch issue-34 where I see that starting with @sap/cds 5.3 the cds.env variable is undefined.

gregorwolf avatar Aug 15 '21 09:08 gregorwolf

Hey @gregorwolf, sadly I haven't found any time until now to look into this and probably won't find any until the next weekend. Great thing you are giving this a start and I will join your efforts as soon as I have time to spent on this.

Kind Regards, Mike

mikezaschka avatar Aug 15 '21 09:08 mikezaschka

cds-dbm build is no longer around in the next release thanks to SAP opening up cds build. Will update and close this once the new version is out.

mikezaschka avatar Oct 05 '21 20:10 mikezaschka