-
Notifications
You must be signed in to change notification settings - Fork 98
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
FlexCard Compilation Error #475
Comments
@lotusboy runtime-plugin-manager-clone looks only for the imports ending with js. copy-anything did ( in my mind an API breaking ) change in 2.0.6 that no longer points to the .js but the cjs. Less depends on it with ^. You can manually fix it by copying copy-anything@2.0.1 into the vlocity-temp/plugins folder while waiting for a fix on this. |
relates: #486 |
This is where the error is thrown: |
When we use copy-anything@2.0.1, we get this error: abort(ReferenceError: sessionStorage is not defined). Build with -s ASSERTIONS=1 for more info. Anyone else getting this? |
Just to add to my above comment, there is an issue in the file: /vlocity-temp/plugins/@omnistudio/flexcard-compiler/src/compiler/flexCardUtility/fetchCustomLabels.js Lines 8-23 and line 104 mention sessionStorage. If you comment some of those lines out, the compiler will work, although from what I've experienced, the compiler doesn't work well if you're using a Vlocity managed package (vlocity-cmt, vlocity-ins etc) |
Is the compiler working on vlocity-cme for you with copy-anything@2.0.6? @AllanOricil |
Yes, but I had to add this version of copy-anything inside The flexcard-compiler had a different error and I had to fix it after it was downloaded. Then I also versioned it inside |
@centricadean I'm also using vlocity-cli@1.15.6 |
OK will give 2.0.6 a go! I'm also having an issue with the compiler using namespace c instead of vlocity_cmt. I tried making some changes in the temp folder for the compiler but some components like c:spinner aren't getting compiled as vlocity_cmt-spinner... |
@AllanOricil I'm running copy-anything@2.0.6 and I'm getting this error:
When I downgrade to copy-anything@2.0.1 I get an error to do with sessionStorage in this file:
Using vlocity@1.15.6 too |
@centricadean You have to end up having these files: index.cjs.js |
Thanks @AllanOricil - that works, but then I get the sessionStorage error again. I'm hitting this error when trying to deploy the LWC cart FlexCards which I think use custom labels. |
This is possibly a new bug. Could you open an issue describing minimal steps to reproduce this error you are experiencing. This will help people to fix it. I can look at it later. |
Raised a new issue, will try a custom Vlocity component with custom labels shortly |
Just tried with latest VBT and latest SFI version (CMT 240.8) OS compiles OK (System Code) LWC created and deployed but definitely not safe given the error |
@KevinGossentCap vlocity build tool does not work like the Metadata API does. There is no such thing as Deploy All or None. You have to deploy everything that has changed over and over again until all errors are fixed. Beside that, in your CI pipeline, you need to read the vlocity job output file to check if there were errors or not, and exit 1 if there were errors. It is a json file which contains everything that was processed by the cli. |
Hi @AllanOricil You should look and read back the subject of this ticket. Loading @vlocity-cme/omniscript-lwc-compiler@latest (System Code) |
@KevinGossentCap would you be able to zip this flexicard datapack and paste it here. I need to use it to debug the compiler. The error message does not help much to determine the root cause of the problem. |
@KevinGossentCap could you also run vlocity cli again but with I'm almost certain it won't show the errors I need because the compiler has its verbose prop hardcoded to My guess is that one of these custom rest services is causing that system limit exception Could you also open your debug logs and try to identify which apex method throws this exception while the compiler is running |
Hi @AllanOricil they are both from "industry CPQ LWC" static ressources. So both provided directly by vlocity/Salesforce. |
Hi again, Here for the verbose output giving the additional result json and still the APEX error:
|
@KevinGossentCap this does not help. I don't have means to repro your error, so Im going to guide you so that we can at least discover which apex code is causing this exception you are seeing. Do you know where the Could you override a function called function executeMethod(methodName, inputMap, params) {
const data = {
sClassName: _namespaceDotNotation + "FlexCardCompiler",
sMethodName: methodName,
input: inputMap ? JSON.stringify(inputMap) : "{}",
options: inputMap ? JSON.stringify(inputMap) : "{}",
...params
};
console.log('executeMethod data');
console.log(JSON.stringify(data));
let url = `${_namespaceSlashNotation}/v1/GenericInvoke/`;
if (_connection) {
return _connection.apex.post(url, data, (err, res) => {
if (err) {
console.log(`Error while executing: ${methodName}`);
return console.error(err);
}
return res;
});
}
return Promise.reject(
"Connection not set. Please do so using setApi method."
);
} Then run the cli again and see if it prints more error messages. |
Hi @AllanOricil , here is the new output
|
Now you can open a ticket to vlocity so that they can fix that apex method that is failing. 😄 u can't fix this apex class because it is inside a managed package. |
Hi @KevinGossentCap and @AllanOricill, the issue with the Apex class is due to be fixed in the next patch (240.9) which is due to be released around 9 December. |
@AllanOricil I'm just hopping that, once the "new first error" is solved, the following will be fully tested to produce a version which can go through all omniscripts & vlocitycards provided with industry CPQ LWC + ESM... |
Yep sadly this issue is not fixed in 240.9. I have a case open and they're saying it will be fixed in 240.11. I won't hold my breath though. Please do raise cases and raise this as an issue as I'm sure a case from each customer will help push Salesforce to rethink their testing practices before releasing and getting our hopes up. |
Hi @centricadean @AllanOricil @manas-sf , I've just tested with latest VBT and latest winter 23 patch (240.11).
You can easily test using the SFI provided industry CPQ LWC. |
Yep, sadly there are still issues with the local compiler. If you compile a Multi-Language FlexCard, then the labels aren't generated and just display as {Label.xxx} when you render the LWC. I have no more updates from Salesforce on this. The saga continues... |
Thanks for the feedback. We have Case#35690448 with FlexCard team and they looking into it. |
@manas-sf there is also Case #43894399 |
@manas-sf and there is also case #43776753. Already closed, but not solved. |
Closed but not solved - great! |
Does anyone already run with 242? I have been told (tentative/safe harbour/...) it should have been solved in 242. |
I would rephrase @thvd question: does anyone use local compilation? On which version if possible? Reading this thread makes the impression that it just doesn’t work. I’m desperately searching for this possibility. We have huge Vlocity project (hundreds omniscripts, flex cards, etc). Currently we are on Spring’22 (900.456). In our case full deployment of just this Vlocity part takes 3-4 hours. And most of the deployment time it is compilation and activation of LWC stuff via puppeteer. Moreover it is very vulnerable to all network and Salesforce instabilities. Then it fails frequently. With growing project size we are approaching the moment where we won’t be able to deploy Vlocity at all. Then local compilation could solve the problem, but does it really work? Anyone? |
Currently it works for us. Latest version of everything. Works ok. As long
as the repository isn't down. Will try to list exact version numbers Monday.
Op za 4 mrt. 2023 16:58 schreef Paweł Idczak ***@***.***>:
… I would rephrase @thvd <https://github.com/thvd> question: does anyone
use local compilation? On which version if possible?
Reading this thread makes the impression that it just doesn’t work. I’m
desperately searching for this possibility. We have huge Vlocity project
(hundreds omniscripts, flex cards, etc). Currently we are on Spring’22
(900.456). In our case full deployment of just this Vlocity part takes 3-4
hours. And most of the deployment time it is compilation and activation of
LWC stuff via puppeteer. Moreover it is very vulnerable to all network and
Salesforce instabilities. Then it fails frequently. With growing project
size we are approaching the moment where we won’t be able to deploy Vlocity
at all. Then local compilation could solve the problem, but does it really
work? Anyone?
—
Reply to this email directly, view it on GitHub
<#475 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHNXDZGJ54UQXMUHZINQTTW2NRBFANCNFSM5YUVUA5Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Not completely sure if it works as, if I follow my shared procedure
We can see that there are A LOT of LWC not produced. |
Replying to myself, it still violently crashes when trying to use it for initial vlocity CME industry CPQ LWC deployment... |
To sum it up
|
@KevinGossentCap can you share the repository and the sfdx cli you used when you set "useSfdxCli" to true? I will take a look and fix it |
|
@KevinGossentCap |
I ran the command with verbose option (just in case)
|
@AllanOricil One information is that it's been 1 or 2 weekly release of SFDX-CLI that salesforce-alm is not used or present anymore. |
@KevinGossentCap could you please run this command.
Save the output of this command to a file and post it here, please. The convertion is failing because it can't convert the json output. But this error shouldn't have stopped the convertion because it wrapped with a try/catch. This means that sfdx is not actually converting anything. Now we need to know exactly why sfdx can't convert your lwc from source to md. |
I'll try but I suspect it won't work as setting parameters before the command work only on unix/linux and not on windows |
Here it is, as I suspected
|
@AllanOricil you'll have to make it more generic with getting if env var exists, and if yes save back the value, then set your value, then put back the initial status of the env var |
@KevinGossentCap that might be the reason for you issue. I recommend you run vlocity on a container image based on Linux until that is fixed. Use this image #572 Or any other image that is based on Linux. |
@AllanOricil no can do. for many security policy reasons it's not an option. |
@KevinGossentCap This is the location for you
|
I think we can make it work as it should with this kind of inspiration : https://stackoverflow.com/questions/58805784/node-js-how-to-pass-environment-variables-with-a-shell-command |
@AllanOricil @thvd with modification to local as indicated in my comment to @thvd 's PR, it makes even OmniScript localCompile work 🎊 |
It is time for implementing integration tests with the following inputs to avoid these little mistakes
|
Hi,
As part of our vlocity deployment, we have 3 FlexCards which are failing to compile and so cannot subsequently be deployed. Omniscripts are compiling successfully.
Interestingly, if I set lwcCompilerVersion: "890.331", meaning the legacy method is used, the FlexCards get compiled and deployed successfully.
Vlocity Build v1.15.3
Vlocity version 890.331
Log showing the first FlexCard error:
...
Loading @vlocity-ins/flexcard-compiler@890.331
Compiling Flexcard with FlexCard ID: >> a6J0E000002GcOkUAK
/usr/local/lib/node_modules/vlocity/node_modules/runtime-plugin-manager-clone/dist/src/PluginVm.js:74
throw new Error("Invalid javascript file " + filePath);
^
Error: Invalid javascript file /Users/sloftus/Documents/git/smartchassis/vlocity-temp/plugins/copy-anything/dist/index.cjs
at PluginVm.load (/usr/local/lib/node_modules/vlocity/node_modules/runtime-plugin-manager-clone/dist/src/PluginVm.js:74:19)
at PluginManager.load (/usr/local/lib/node_modules/vlocity/node_modules/runtime-plugin-manager-clone/dist/src/PluginManager.js:553:24)
at PluginManager.require (/usr/local/lib/node_modules/vlocity/node_modules/runtime-plugin-manager-clone/dist/src/PluginManager.js:191:21)
at PluginVm.sandboxRequire (/usr/local/lib/node_modules/vlocity/node_modules/runtime-plugin-manager-clone/dist/src/PluginVm.js:252:33)
at Object.assign.resolve (/usr/local/lib/node_modules/vlocity/node_modules/runtime-plugin-manager-clone/dist/src/PluginVm.js:178:25)
at /Users/sloftus/Documents/git/smartchassis/vlocity-temp/plugins/less/lib/less/utils.js:8:23
at /Users/sloftus/Documents/git/smartchassis/vlocity-temp/plugins/less/lib/less/utils.js:127:2
at Script.runInContext (node:vm:139:12)
at PluginVm.vmRunScriptInSandbox (/usr/local/lib/node_modules/vlocity/node_modules/runtime-plugin-manager-clone/dist/src/PluginVm.js:136:16)
at PluginVm.load (/usr/local/lib/node_modules/vlocity/node_modules/runtime-plugin-manager-clone/dist/src/PluginVm.js:61:22)
...
The text was updated successfully, but these errors were encountered: