I want to use the decimate modifier to make some LODs of a mesh, and this mesh has a very huge number of shapekeys which I must preserve. I can't apply the decimate modifier with a mesh with shapekeys.
For this you must re-create all shape keys for each LOD-version of your mesh. You can try to do this. First making LOD-version by applying Decimate modifier to copy of your high-poly mesh with all shape keys deleted.
Then, sequentially turn on each shape key on your original high-poly mesh and apply Shrinkwrap modifier to previously made LOD-version as a shape key targeting that high-poly mesh with shape key turned on.
That is, add Shrinkwrap modifier to low-poly ('decimated') mesh. In your high-poly mesh turn on particular shape key by set it value to 1. Select your high-poly mesh as a target in Shrinkwrap modifier. Click 'Apply as Shape Key' on Shrinkwrap modifier. If all went good you would had particular shape key transferred from high-poly to low-poly model.
What you want to do is not possible. Shapekeys require the geometry of a object, and modify it; However when a Decimate modifier is added, some vertices are decimated, and just stop doing the general existing thing; Also, the vertex order is modified.
Think of it like this: you have a list which stores the position a vertex, associated with an index, for each vertex; Imagine you are trying to define some specific info about the mesh, by referring to the vertices by their index, what would happen if suddenly one vertex was deleted and the following indexes where shifted in order to maintain continuity? You'd end up trying to refer to the wrong vertex, so it was removed altogether.
As stated above, this CAN be done. You can use go into Edit Mode, go to the menu for Mesh, Mesh Cleanup, Decimate. I just did this and it DOES work, turning my high res Ps5 style models into deliciously terrible, yet facially animated, Half Life 1 style models. The shape keys ARE preserved by this, but not by the modifier, weirdly.