function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Unlocked Package Install Failing with Preview Sandbox

We have built our entire production org using Unlocked Packages (with the exception of our Community because that doesn't seem to deploy well with UP.)

Production is on Winter 20 and our Sandboxes are now on Preview. Our first package for an install is a "Foundation" package, it contains no profiles or community related metadata, essentially objects, layouts, duplicate rules etc.

Now when installing into a Spring 21 Sandbox it fails with the following error message in VS Code.

1) (xxx Portal Client User) Cannot update: userLicense, Details: CXC Portal Client User: Cannot update: userLicense
2) (xxx Portal User) Cannot update: userLicense, Details: CXC Portal User: Cannot update: userLicense
3) (Myxxx Portal Profile) Cannot update: userLicense, Details: MyCXC Portal Profile: Cannot update: userLicense

These are all Community Users (first two linked to Community User License and last one linked to Guest User License)

The error says nothing about corrective action and what is hard to understand is NOTHING in the Foundation package (no dependency, Classes or LWC) contains a reference to the Profiles for the Portal.

I did also create a new sandbox not on a preview instance and the packages work fine.  Obviously something to do with Preview changes but can't think what.
VinayVinay (Salesforce Developers) 
HI Alfo,

Issue seems to be with userLicense.  Can you try using "Match Production Licenses"?