When I select a layer in the Contents and click on the "New Web Layer" button in the Share As category in the Share ribbon, Analyze says I have warnings because of the basemap. However, I don't care about the basemap; I intentionally selected the layer because I only want to share the layer.
When I right-click on the layer and click on the "Share As Web Layer" menu item, I get a different panel named "Sharing selected layer as a web layer" that correctly populates the Name and does not complain about the basemap.
However, there is no way to get to the correctly-working user interface from the ribbon.
Please add this hidden feature to the main ribbon to make it more discoverable. Menus (Design basics) - Win32 apps | Microsoft Docs says that items in the context menu should be redundant with the main UI.