SalesforceCommerceCloud / b2c-crm-sync

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
https://salesforcecommercecloud.github.io/b2c-crm-sync/
BSD 3-Clause "New" or "Revised" License
64 stars 47 forks source link

Error deploying sync to SF Sandbox (npm run crm-sync:sf:org:deploy) #57

Closed VALiNTRY360 closed 2 years ago

VALiNTRY360 commented 2 years ago

Describe the bug We are attempting to deploy this solution to a sandbox (no scratch orgs) and are running into an error when executing the npm run crm-sync:sf:org:deploy command.

Error message is (screenshot included): _[ { "stack": "TypeError: Cannot read properties of undefined (reading 'string')\n at /Users/luigifrascarelli/b2c-crm-sync/node_modules/@oclif/core/node_modules/cli-ux/lib/styled/table.js:285:34\n at Object. (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@oclif/core/node_modules/cli-ux/lib/styled/table.js:314:3)\n at Module._compile (node:internal/modules/cjs/loader:1097:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)\n at Module.load (node:internal/modules/cjs/loader:975:32)\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n at Module.require (node:internal/modules/cjs/loader:999:19)\n at require (node:internal/modules/cjs/helpers:102:18)\n at Object. (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@oclif/core/node_modules/cli-ux/lib/index.js:14:36)\n at Module._compile (node:internal/modules/cjs/loader:1097:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)\n at Module.load (node:internal/modules/cjs/loader:975:32)\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n at Module.require (node:internal/modules/cjs/loader:999:19)\n at require (node:internal/modules/cjs/helpers:102:18)\n at Object. (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@oclif/core/lib/command.js:6:18)", "message": "Cannot read properties of undefined (reading 'string')", "name": "TypeError" } ]

CRM-SYNC | v0.9.0 | crm-sync:sf:deploy: END_

Node version (node -v): v15.2.1 NPM version (npm -v): 7.0.8. SFDX version (sfdx -v): sfdx-cli/7.127.0 darwin-x64 node-v16.13.0

Screen Shot 2021-11-24 at 1 44 07 PM

VALiNTRY360 commented 2 years ago

Update on error:

Used the fix referenced by another user @regist84 in a previous post: i bypass this error modifing the file "/home/ranosys/Downloads/b2c-crm-sync/b2c-crm-sync/node_modules/@oclif/core/lib/command.js". I changed the row 6 from "const cli_ux_1 = require("cli-ux");" to "const cli_ux_1 = require("../../../cli-ux");"

Now getting a new error message: _[ { "stack": "RequiresDevhubUsernameError: This command requires a dev hub username. Specify it with the -v parameter or with the \"sfdx config:set defaultdevhubusername=\" command.\n at Function.create (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/sfdxError.js:160:16)\n at UserDisplayCommand.assignHubOrg (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:144:44)\n at async UserDisplayCommand.init (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:235:13)\n at async UserDisplayCommand._run (/Users/luigifrascarelli/b2c-crm-sync/nodemodules/@salesforce/command/lib/sfdxCommand.js:80:13)", "message": "This command requires a dev hub username. Specify it with the -v parameter or with the \"sfdx config:set defaultdevhubusername=\" command.", "name": "RequiresDevhubUsernameError", "exitCode": 1, "commandName": "UserDisplayCommand", "code": "Error" }

VALiNTRY360 commented 2 years ago

FYI - this is a SF sandbox and cannot enable DevHub https://help.salesforce.com/s/articleView?id=sf.sfdx_setup_enable_devhub.htm&type=5

How do we deploy to a SF sandbox without enabling the DevHub?

VALiNTRY360 commented 2 years ago

Solved by entering same credentials in the ENV file for the DevHub credentials.