The Welsh Ambulance Service said it responded to reports a pedestrian was struck as she ran into the carriageway after a dog that had got loose.
The incident happened at about 18:20 BST near Cardiff Gate and the woman was pronounced dead at the scene.
The motorway remains closed westbound between junctions 29 and 32 as police investigate.
Motorists have been told to avoid the area and traffic is being diverted onto the A48M at junction 29.
A woman has died after it is believed she was hit by a van while chasing a dog on the M4 near Cardiff.