I'd like to start developing LWCs in my dev sandbox, but it's current api version is 44. I get this error when trying to deploy my lwc.
Starting SFDX: Deploy Source to Org
19:30:37.961 sfdx force:source:deploy –json –loglevel fatal –sourcepath /Users/tyler/code/salesforce/HelloWorld/force-app/main/default/lwc
{"message":"Deploy failed.","status":1,"stack":"DeployFailed: Deploy failed.\n at ALMError (/Users/tyler/.local/share/sfdx/plugins/node_modules/salesforce-alm/dist/lib/almError.js:44:19)\n at MetadataRegistry.initializeMetadataTypeInfos.then.catch.e (/Users/tyler/.local/share/sfdx/plugins/node_modules/salesforce-alm/dist/lib/source/sourceApiCommand.js:67:35)\n at tryCatcher (/Users/tyler/.local/share/sfdx/plugins/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/Users/tyler/.local/share/sfdx/plugins/node_modules/bluebird/js/release/promise.js:510:31)\n at Promise._settlePromise (/Users/tyler/.local/share/sfdx/plugins/node_modules/bluebird/js/release/promise.js:567:18)\n at Promise._settlePromise0 (/Users/tyler/.local/share/sfdx/plugins/node_modules/bluebird/js/release/promise.js:612:10)\n at Promise._settlePromises (/Users/tyler/.local/share/sfdx/plugins/node_modules/bluebird/js/release/promise.js:687:18)\n at Async._drainQueue (/Users/tyler/.local/share/sfdx/plugins/node_modules/bluebird/js/release/async.js:138:16)\n at Async._drainQueues (/Users/tyler/.local/share/sfdx/plugins/node_modules/bluebird/js/release/async.js:148:10)\n at Immediate.Async.drainQueues (/Users/tyler/.local/share/sfdx/plugins/node_modules/bluebird/js/release/async.js:17:14)\n at runCallback (timers.js:789:20)\n at tryOnImmediate (timers.js:751:5)\n at processImmediate [as _immediateCallback] (timers.js:722:5)","name":"DeployFailed","result":[{"error":"Invalid version specified:45.0","type":"","filePath":"N/A"}],"warnings":["All –json output, including on error, is moving to stdout. Use the SFDX_JSON_TO_STDOUT environment variable to move over to the new functionality. This will become the default in version 45."]}
19:30:40.979 sfdx force:source:deploy –json –loglevel fatal –sourcepath /Users/tyler/code/salesforce/HelloWorld/force-app/main/default/lwc ended with exit code 1
Has anyone else been able to successfully deploy a lwc to an org with an api version that is not 45?
Best Answer
Short answer , you will need pre-release org and API version 45 atleast.
Sign up here for the pre-release org https://www.salesforce.com/form/signup/prerelease-spring19/
You will need pre-release CLI plugin to scaffold the bundle .Install the SFDX CLI (https://developer.salesforce.com/tools/sfdxcli) and then install pre release DX plugin
sfdx plugins:install salesforcedx@pre-release
.Install the VScode extension pack for salesforce https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode to get syntax autocomplete , deploy and other language features .