cli
cli copied to clipboard
Pushing source: Cannot read properties of undefined (reading 'split')
Summary
When trying to push the source to an org, I get the following JSON response from the CLI:
{
"status": 1,
"name": "Type",
"message": "Cannot read properties of undefined (reading 'split')",
"exitCode": 1,
"context": "Push",
"stack": "Type: Cannot read properties of undefined (reading 'split')\n at Function.wrap (C:\\Users\\Luke\\AppData\\Local\\sfdx\\client\\7.161.0-7a9b98c\\node_modules\\@salesforce\\core\\lib\\sfError.js:61:25)\n at Push.catch (C:\\Users\\Luke\\AppData\\Local\\sfdx\\client\\7.161.0-7a9b98c\\node_module
s\\@salesforce\\command\\lib\\sfdxCommand.js:267:38)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Push._run (C:\\Users\\Luke\\AppData\\Local\\sfdx\\client\\7.161.0-7a9b98c\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:93:13)\n at async Config.runComman
d (C:\\Users\\Luke\\AppData\\Local\\sfdx\\client\\7.161.0-7a9b98c\\node_modules\\@oclif\\config\\lib\\config.js:173:24)\n at async SfdxMain.run (C:\\Users\\Luke\\AppData\\Local\\sfdx\\client\\7.161.0-7a9b98c\\node_modules\\@oclif\\command\\lib\\main.js:27:9)\n at async SfdxMain._run (C:\\Users\\Luke\\Ap
pData\\Local\\sfdx\\client\\7.161.0-7a9b98c\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\n at async Object.run (C:\\Users\\Luke\\AppData\\Local\\sfdx\\client\\7.161.0-7a9b98c\\dist\\cli.js:162:47)",
"warnings": [],
"commandName": "Push"
}
I have not been able to pin-point a cause for this. In my mind - it happens randomly but we all know that's not the case.
What I do know is that the issue seems to be a non-issue in terms of the project metadata itself because I am able to create a new org and push the exact same source without issue. Perhaps it may be to do with source tracking - I don't know.
Steps To Reproduce:
I don't have steps to reproduce this other than simply pushing using sfdx force:source:push.
System Information
- Powershell 7
{
"cliVersion": "sfdx-cli/7.161.0",
"architecture": "win32-x64",
"nodeVersion": "node-v16.16.0",
"pluginVersions": [
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.3.1 (core)",
"@oclif/plugin-not-found 1.2.6 (core)",
"@oclif/plugin-plugins 1.10.11 (core)",
"@oclif/plugin-update 1.5.0 (core)",
"@oclif/plugin-warn-if-update-available 1.7.3 (core)",
"@oclif/plugin-which 1.0.4 (core)",
"@salesforce/sfdx-plugin-lwc-test 1.0.0 (core)",
"alias 2.1.0 (core)",
"apex 1.1.0 (core)",
"auth 2.2.3 (core)",
"community 2.0.0 (core)",
"config 1.4.14 (core)",
"custom-metadata 2.0.0 (core)",
"data 2.0.4 (core)",
"generator 2.0.2 (core)",
"info 2.0.1 (core)",
"limits 2.0.1 (core)",
"org 2.0.5 (core)",
"salesforce-alm 54.6.3 (core)",
"schema 2.1.1 (core)",
"sfdx-cli 7.161.0 (core)",
"sfdx-npm 0.0.31",
"signups 1.2.0 (core)",
"source 2.0.9 (core)",
"telemetry 2.0.0 (core)",
"templates 55.0.0 (core)",
"trust 2.0.1 (core)",
"user 2.1.0 (core)"
],
"osVersion": "Windows_NT 10.0.19044"
}
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
@LKozakewycz I'm unable to reproduce this using the dreamhouse-lwc project. Are you able to provide a project that consistently reproduces the issue? Thanks!
@mdonnalley There is no consistency with it and I have only experienced it with our own private project.
I'm kind of hoping, if anything, the stack trace alone is able to pin-point an area of fault.
I'm getting this right now. Cannot read properties of null (reading 'split') Can provide anything required
@booknownick Do you have the same strack trace in the error response?
@LKozakewycz also happens on pull, but yes the stack trace seems to be similar.
nickthurston@Nicks-MBP BookNow Software Dev Hub] % sfdx force:source:pull --json { "status": 1, "name": "Type", "message": "Cannot read properties of null (reading 'split')", "exitCode": 1, "context": "Pull", "stack": "Type: Cannot read properties of null (reading 'split')\n at Function.wrap (/Users/nickthurston/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/@salesforce/core/lib/sfError.js:61:25)\n at Pull.catch (/Users/nickthurston/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/@salesforce/command/lib/sfdxCommand.js:235:38)\n at async Pull._run (/Users/nickthurston/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/@salesforce/command/lib/sfdxCommand.js:93:13)\n at async Config.runCommand (/Users/nickthurston/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/@oclif/core/lib/config/config.js:270:25)\n at async run (/Users/nickthurston/.local/share/sfdx/client/7.163.0-ea5a9c6/node_modules/@oclif/core/lib/main.js:76:5)", "warnings": [], "commandName": "Pull" }
Hey all, I am also unable to reproduced this with Dreamhouse-lwc. If one of you are able to provide a repo with steps to reproduced this we will be happy to look into it further.
Taking a look at the debug logs might also help. Example: DEBUG=* sfdx force:source:push
Thanks @iowillhoit. I will give that a try next time it occurs. Unfortunately I can't see any consistency with it's occurrence. It doesn't happen all the time, but when it does I have to build a new org and push. Unfortunately that process takes 30-45 mins for our project each time.
I haven't tried it with the Dreamhouse app but I wouldn't know what to look for when it comes to reproducing the error. I was just kind of hoping someone had more of a clue as to what to look for with the stack trade provided but perhaps the trace doesn't contain enough information itself (thread related I guess).
Will give the DEBUG flag a go.
Hey all, resolved this issue by doing a folder swap on my project and pulling from Git. Feels like it was caused by the update of the CLI to sfdx-cli/7.163.0.
Had the same issue on .161 and .166.
Here's what I did: I renamed 2 LWC Util CMPs (no html template) but did not rename the parent folder.
When pushing, I got the split error. After re-creating Org (resetting source tracking did not help) I got the actual error message 'missing base file' which helped me realize my negligence.
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.
I am working on a salesforce DX building LWC when trying to push the components to org it gives me this error, all code base seems to be okay and bug-free

I was getting the same error running sfdx force source push with sfdx-cli/7.201.6 darwin-x64 node-v18.15.0
After creating a clean scratch org it turns out the problem was due to a JavaScript file that does not compile.
I tried reproducing with just the one broken file -- but in that case it gave a clean error.
It seems the error occurs only if one broken file is included in a larger update (in my case ~40 modified files)
@iowillhoit I captured the debug log but it wasn't showing obvious errors. Is there something specific you're looking for?
Here's a few lines up to and including the error:
sf:MetadataApiDeploy DEBUG MDAPI status update: InProgress +568ms
sf:MetadataApiDeploy DEBUG MDAPI status update: InProgress +585ms
sf:MetadataApiDeploy DEBUG MDAPI status update: InProgress +890ms
sfdx:Lifecycle A lifecycle event with the name postdeploy does not exist. An event must be registered before it can be emitted. +1ms
sf:core TRACE Setup child 'ComponentSet' logger instance +1m572ms
Error (1): Cannot read properties of undefined (reading 'split')4ms```