I want to update a managed package to the current version.

The problem is that in the later version I've removed some VF pages as well as the controllers for these pages. It turned out that the deleted pages REMAIN in the org as a deprecated page (makes sense), AND they need a controller. So I've getting the following error on package update:

Salesforce has blocked this package upgrade because the new package version removes some Apex code that one or more Visualforce pages or global Visualforce components need in order to function. Please contact your partner with this error information. Provide these component names to your partner. Visualforce Pages: PaymentGateway_SyncCoupons, Stripe_Setup, PaymentGateway_SyncSubscriptions, PaymentGateway_SyncPlans, PaymentGateway_SyncInvoices.

How to fix this? I think I can't recreate these controllers in the package (with the same names) as they are already deleted.


1 Answer 1


Salesforce is a little finicky when it comes to removing stuff. Unfortunately (and I've lived through this before), removing pages and controllers is a two step process.

First, you have to make sure that all the dependencies for a given class are removed (or the dependency removed). Only then, in a second update, you can get rid of the class.

So, do this:

  1. Issue a package update without the pages, or with the pages but remove the controller tag, to eliminate the relationship with your class
  2. Issue a second update, removing what you want to eliminate

Remember, you may not be able to recreate those classes (I think you may be able to) but you can always update the pages to no longer need them.

As long as the classes aren't global, you should be in good shape.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .