-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cds-ui5-plugin] Errors relating to: cds warning - Returning an 'activate' function is deprecated and won't be supported in future releases. → Please return a Promise with 'module.exports' instead #899
Comments
Instead of supporting both variants, activate hook in object vs. Promise, the activate hook has been completely removed to avoid a switch statement based on version. This ensures simplicity of code and it wasn't needed at all... Fixes #899
Instead of supporting both variants, activate hook in object vs. Promise, the activate hook has been completely removed to avoid a switch statement based on version. This ensures simplicity of code and it wasn't needed at all... Fixes #899
Strange, the log from the activate in the
It seems that is somehow adds the log statement (with the color information for the console) to it... The issue should be solved with version For the testing issue - can you just create another issue, referring to this one but with the ZIP attached which I can just run? Did you try to run the test without the |
Hi @petermuessig I can confirm that when you remove the |
Ok, good to know - the segmentation fault seems to be a bit weird. Need to check what the reasoning for it is... |
@js1972 - but you used the new version of the |
@petermuessig yes - even with 0.7.1 still get the segment fault when running jest test. Will add you to my test repo. https://github.tools.sap/BTP-CEE/consumptionopps (main branch). If you clone this and run |
@petermuessig good news is that with 0.7.1 the activate function warning/error has gone and also the corrupt xs-security.json issue is resolved. |
@js1972 -> the issue is the following: The |
fwiw: experienced the same segfaulting-behaviour with jest in a cap project containing an openapi-express plugin that in turn uses |
@vobu - but what exactly did you patch? remove the |
yeah, that ugliness is exactly what we did: |
Hmm, I think this can't be fixed easily in the Jest issue (one of them): jestjs/jest#12286 After upgrading my local nodejs to 21 and using the following command line: NODE_OPTIONS=--experimental-vm-modules jest tests/test.js it works... I have to admit, that I can't help here and this needs to be fixed using a newer Node.js version plus enabling the ESM support for JEST: https://jestjs.io/docs/ecmascript-modules Sorry... |
@petermuessig is there a way to bypass or turn off the cds plugin when running the tests maybe? If not it means the plugin is not compatible with cap testing which is a shame. Maybe via an envar? |
Moving the discussion to #901 |
The above warning is causing multiple issues with a CAP project.
I have started a new CAP project. Created a very simple test data model and added a fiori elements app to the /app folder using the fiori tools app generator. I selected the generator option to use the
cds-ui5-plugin
plugin and typescript.When I run the app with
cds watch
I get this in the console:The app still seems to work okay. but always issues this warning.
Except, when I try to regenerate the xs-security.json file with this command:
The plugin seems to corrupt the generated xs-security.json file by adding this to the beginning:
If I manually delete those lines from the xs-security.json then the file seems valid.
Additionally, when setting up a simple jest test for the CAP service it fails with this:
Full log output:
To Reproduce
Desktop (please complete the following information):
@cap-js/sqlite: 1.3.1
@sap/cds: 7.3.1
@sap/cds-compiler: 4.3.2
@sap/cds-dk: 7.3.1
@sap/cds-dk (global): 7.3.0
@sap/cds-fiori: 1.1.0
@sap/cds-foss: 4.0.2
@sap/cds-hana: 2.0.0
@sap/cds-mtxs: 1.12.1
@sap/eslint-plugin-cds: 2.6.3
Node.js: v18.18.0
cds-plugin-ui5: 0.6.14
The text was updated successfully, but these errors were encountered: