Comments (9)
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.
Fixed in version 1.11.
Thank you @gregorwolf, @ajewelbd and @ryegrosT8.
from cds-dbm.
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.
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.
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.
Please check my update @ryegrosT8. Maybe you have some time to check if it's working.
from cds-dbm.
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?
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.
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.
@ajewelbd would be great if you can provide the correction in the TypeScript source.
from cds-dbm.
Related Issues (20)
- To create procedure like we create .hdbprocedure in sap HANA HOT 1
- Error Deploy in another Schema HOT 6
- Error when trying to deploy cap using a postgis db
- "bash: ./deploy.sh: Permission denied (STDERR, APP/TASK/deploy_to_postgresql)" while deploying to cloud foundry HOT 6
- Can't use the deploy delta HOT 1
- Strong security issue regarding indirect dependency to jsonwebtoken npm-module 8.x HOT 2
- Support to CDS 6.5.0 and cds-pg 0.1.35 HOT 1
- Cannot find module 'date-format' HOT 3
- [cds-dbm] - failed to load model undefined HOT 4
- CDS-DBM Deploy Error: TypeError: Cannot read properties of undefined (reading 'definitions') HOT 1
- TypeError: Cannot read properties of undefined (reading 'definitions') HOT 3
- Cannot read properties of undefined (reading 'regularRegex') HOT 3
- TypeError: Cannot read properties of undefined (reading 'regularRegex') HOT 5
- Multiple Postgres Database Projects cause reference schema to be overwrtten HOT 2
- cflinuxsf4 not supported as stack for nodejs_buildpack? HOT 3
- Imported Schema Definition dropped from gen/srv/srv/csn.json HOT 1
- Redeploying causes error (Cannot read properties of undefined (reading 'definitions') HOT 1
- Column names become case-insensitive during CAP Deployment
- Initial Release schedule? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cds-dbm.