[[WMG:Shahrazad has access to a time machine.]]

How else could she be telling the king stories of events that hadn't happened yet? The frame story takes place prior to the rise of Islam; many of the internal stories do not.
* Maybe she's just really good at guessing? H.G. Wells predicted the invention of the satellite, after all...