6

With Spring '19 around the corner, I decided to set up a pre-release org and upgraded my client to 45.x. After playing around a bit, I then went back to work on my actual work projects, and came across an error:

ERROR: The configured apiVersion 45.0 is not supported for this org. The max apiVersion is 44.0.

Now, I'm not able to do any work in my sandbox! Is there a way I can use the correct API version in each project? For now, I have to switch between installing salesforcedx@latest and salesforcedx@pre-release each time I want to switch modes.

15

After moving into a project folder, specify a version override with the following command:

sfdx force:config:set apiVersion=44.0

This will allow you to use the newer 45.0 features in a LWC project, whilst still being able to work in a 44.0 org without any errors.

Make sure that, if you're playing with an advanced version of the API, that you keep the salesforcedx@pre-release plugin installed until it is upgraded to the latest release.

  • Thanks, brilliant timing. I was just looking for this! – berry120 Dec 17 '18 at 15:55
  • So, is it the case that a scratch org is 'locked' to the API version in which it was created? Or do they get updated when a release is pushed? I know it's not that big a deal since the half-life of a scratch is short... just curious. – PatMcClellan__c Jan 18 at 17:44
  • @PatMcClellan__c It's not documented, but I presume so. I've heard they're working on a way to let us specify a version during pre-release windows, but I have no confirmation on this one way or the other. – sfdcfox Jan 18 at 17:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.