0

I am trying to do a simple push of my vscode to my scratch org using sfdx force:source:push -u [email protected] and I run into this error

Type Project Path Problem
Error force-app\main\default\appMenus\AppSwitcher.appMenu-meta.xml The AppMenu called 'AppSwitcher' is standard and cannot be deleted

In my directory, I don't have the appMenus folder at all. I can't figure out why this problem is showing up and what does the error message actually mean

DirectoryScreenshot

0

1 Answer 1

1

Sometimes there's quirks with the standard metadata types - it's expecting it to be in your source as every org has two AppMenu files (AppSwitcher.appMenu & Salesforce1.appMenu). Since it's not there, it seems it attempts to delete it (which isn't possible).

You'll either want to do one of the following

  • Retrieve the AppMenu metadata from your source org into your repository
  • Exclude AppMenu in your .forceignore file for source commands so it ignores this metadata type in CLI source commands.

I'd recommend ignoring it as it doesn't add any value in your source - there's issues deploying it as such to re-order app menu items and users can easily customize the order of apps that display in the app launcher in Lightning anyway.

enter image description here

You can see an example of this being done in the lwc-recipes repository for certain standard metadata which includes appMenus

# Standard metadata
package.xml
**/appMenus/**
**/appSwitcher/**
**/objectTranslations/**
**/profiles/**
**/settings/**

# LWC configuration files
**/jsconfig.json
**/.eslintrc.json

# LWC Jest
**/__tests__/**
2
  • I was of the understanding that the deployments that we do are never destructive. I've followed that principle whenever deploying things like profiles as it prevents removal of any existing configuration. However that has always been with ANT & metadata API. Do the SFDX source deployments work differently or it is only this specific type that behaves in this manner where an attempt to delete is made if is is not present in the source ?
    – N_H1922
    Jan 8, 2022 at 12:08
  • 1
    AppMenu is unique. However, force:source:push syncs changes from your local project to your org and is different than a deployment with ANT specifying exactly what to deploy. With force:source:push being a sync - if you delete a file in VS Code (ex. apex class, layout, etc) and run the command - it will sync those changes which would be a destructive action. force:source:deploy is the other command closer to what you might be used to with ANT. Profiles are their own world, but the same rules apply across tools as it's all the metadata API behavior. Jan 8, 2022 at 14:18

You must log in to answer this question.

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