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
Brooks Johnson 6Brooks Johnson 6 

unlocked package version errors

Hi Friends,

Getting some weird errors when I try to run package:version: create

The classes that are being listed in the errors are in another package. The dependency is defined in the JSON and I  updated this package version today. Any thoughts on what would be going wrong here?

Short of just removing all the dependencies and starting over.
ContactStatusManager_Test: Variable does not exist: TestDataFactory,AppSwitcher: An unexpected error occurred. Please include this Err
orId if you contact support: 169023167-52320 (442557440),Admin: In field: apexClass - no ApexClass named CampaignMemberStatusFactory found,CampaignMemberStatusTriggerHandler: Depe
ndent class is invalid and needs recompilation:
 Class CampaignMemberStatusFactory : Variable does not exist: RecordTypeSelector,CampaignMemberStatusFactory: Variable does not exist: RecordTypeSelector,ContactStatusManager_Test
: Variable does not exist: TestDataFactory

Khan AnasKhan Anas (Salesforce Developers) 
Hi Brooks,

Greetings to you!

I tried to research your problem and found that this is a known issue. Keep watching this issue until get fixed.

You can select the 'This Issue Affects Me' button to report your account and receive updates.

Head to Setup > Develop > Apex Classes, and then click "Compile all classes" to recompile Apex classes. This should alleviate the error, even if only temporarily.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Brooks Johnson 6Brooks Johnson 6
Hi Khan, I have tried to recompile several times with no success. I am going to comment out the code that is throwing errors. create a version. Then uncomment and create a new version and see if that works. 
Brooks Johnson 6Brooks Johnson 6
Follow up 'manual recompilation worked' I commented out the classes that were throwing errors and created a new version. I then uncommented and created on more version successfully,