Skip to content
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

Vlocity omniscript-lwc-compiler throws InvalidProjectWorkspace error when force-app folder are not present. #702

Open
juliolimasfdc opened this issue Nov 28, 2024 · 1 comment

Comments

@juliolimasfdc
Copy link

juliolimasfdc commented Nov 28, 2024

When I try do deploy Flexicards and OmniScripts and compile them through omniscript-lwc-compiler or flexcarcd-compiler and the base folder of the project doesn't have the force-app folder, it throws an error:

Starting OmniScript LWC Compilation >> OmniScript/MY_OS_English (xxx)
Retrieving OmniScript definition
Compiling OmniScript LWC Component
Specified path does not exist. Creating it now...
Salesforce Org >> ***
Version Info >> v1.17.10 vlocity_cmt 900.575
Current Status >> Deploy
Remaining >> 0
Success >> 1
Error >> 0
Elapsed Time >> 0m 7s
Deploying generated LWC components 
Using salesforce-alm
Running source:convert 
{
  "name": "InvalidProjectWorkspace"
}
InvalidProjectWorkspace: The path D:\temp-folder\force-app

sfdx-project.json looks like:

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "name": "SalesForce",
  "namespace": "",
  "sfdcLoginUrl": "https://test.salesforce.com",
  "sourceApiVersion": "62.0"
}
npm ls -g
/Users/myuser/.nvm/versions/node/v20.9.0/lib
├── @vlocity-cme/flexcard-compiler@900.575.0
├── @vlocity-cme/omniscript-lwc-compiler@900.575.0
├── corepack@0.20.0
├── npm@10.1.0
├── puppeteer@23.9.0
└── vlocity@1.17.10

The way the pipeline is configured it does a diff in git and just have the changed files in commit. If there isn't changes in metadata files, it doesn't create the force-app in a deployment temp folder.

@juliolimasfdc juliolimasfdc changed the title InvalidProjectWorkspace Vlocity omniscript-lwc-compiler throws InvalidProjectWorkspace error when force-app folder are not present. Nov 28, 2024
@juliolimasfdc
Copy link
Author

The problem is a bit more complex than I initially thought.
At first, I was trying to deploy only omniscripts to validate that it works, and the above error occurred because the sfdx-project.json file in the root directory contains the packageDirectories of the force-app folder. That's why the error above appeared.

sfdx-project.json

{
    "packageDirectories": [
        {
            "path": "force-app",
            "default": true
        }
    ],
    "name": "commsdeploy",
    "namespace": "",
    "sfdcLoginUrl": "https://login.salesforce.com/",
    "sourceApiVersion": "62.0"
}

After creating an empty force-app folder, I was able to successfully deploy a test omniscript.

The problem now is that when the force-app folder contains its metadata, a task in the omniscript-lwc-compiler plugin called salesforce-alm validates the force-app directory, and when some types of metadata are present, such as OmniInteractionConfig.

I tried to identify some other cases and I found the documentation that mention that some problems can happen, so the sfdx-project.json should be change. https://help.salesforce.com/s/articleView?id=sf.os_build_tool_summary_commands.htm&type=5
Is there another workaround? Because all deployment commands are executed in the root project folder where the sfdx-project.json resides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant