Giter Club home page Giter Club logo

Comments (9)

gregorwolf avatar gregorwolf commented on September 15, 2024 1

The deployment in the db module is failing with:

Error: [cds-dbm] - failed to load model undefined

I guess it is the same root cause because in the deployed version the patch has not been applied. Please check my PR #295.

from cds-dbm.

mikezaschka avatar mikezaschka commented on September 15, 2024 1

Fixed in version 1.11.
Thank you @gregorwolf, @ajewelbd and @ryegrosT8.

from cds-dbm.

ryegrosT8 avatar ryegrosT8 commented on September 15, 2024

Hi @gregorwolf ,

Actually, I didn't deploy my project yet to BTP after the last changes.

But I think I got what is happening, the PostgresCfModuleBuilder extends BuildTaskHandlerInternal of @sap/cds package, in the previous version there was a public property called "env" that was "wrapping” the "cds.env".

I checkout your https://github.com/gregorwolf/pg-beershop/tree/feat/update-to-cds-6 and made a change directly at node_modules/cds-dbm/dist/build/postgres-cf/index.js and seems to work.

Would you mind helping me to test if there is anything else wrong?

Could you please replace the line 81 at node_modules/cds-dbm/dist/build/postgres-cf/index.js from:

            return ((extname !== FILE_EXT_CSV && extname !== FILE_EXT_CDS && entry !== this.env.build.outputfile) ||

to:

            return ((extname !== FILE_EXT_CSV && extname !== FILE_EXT_CDS && entry !== cds_1.default.build['outputfile']) ||

And see if there is anything else out of expected by running pgbeershop?

I will submit a new PR here tomorrow if it works well for you.

from cds-dbm.

gregorwolf avatar gregorwolf commented on September 15, 2024

Hi @ryegrosT8,

yes, this fixes the build issue. I still had the issue that the deployed srv did not start anymore with "cds run" so I changed that to ""node node_modules/@sap/cds/bin/cds.js run".

CU
Gregor

from cds-dbm.

ryegrosT8 avatar ryegrosT8 commented on September 15, 2024

Hi @gregorwolf ,

Sorry to be late, I got a busy day here today and wasn’t able to submit the PR.

I guess that should be "cds.env.build['output file']" instead of "cds.default.build['output file']", isn't right?

from cds-dbm.

gregorwolf avatar gregorwolf commented on September 15, 2024

Please check my update @ryegrosT8. Maybe you have some time to check if it's working.

from cds-dbm.

ryegrosT8 avatar ryegrosT8 commented on September 15, 2024

Still with error when try to run npm run build:cf, the last commit ccca821 seems to undo the rigth one 6e26f63.

About the error Error: [cds-dbm] - failed to load model undefined , I had a similar error in my project, could you try to especify the folders that holds your cds database files here at your package.json and check if it works?

image

It works on my local copy after build the default-env.json and calling :
node node_modules/cds-dbm/dist/cli.js deploy --create-db --load-via delta

from cds-dbm.

ajewelbd avatar ajewelbd commented on September 15, 2024

Hi,
If almighty Allah want's, below code can fix the issue:

dist/config.js:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.config = void 0;
const config = async (service) => {
await cds.connect();
const _serviceOptions = cds.env.requires[service];
const _dbInfo = _serviceOptions.kind ? _serviceOptions.kind : {};
const serviceOptions = {..._serviceOptions, ...cds.env.requires[_dbInfo]};

// @ts-ignore
const migrationOptions = cds.env.migrations[service];
return {
migrations: migrationOptions,
service: serviceOptions,
};
};
exports.config = config;
//# sourceMappingURL=config.js.map

I test it in local environment.
Thanks

from cds-dbm.

gregorwolf avatar gregorwolf commented on September 15, 2024

@ajewelbd would be great if you can provide the correction in the TypeScript source.

from cds-dbm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.