Can you try calling E.unmountSD() before you remove the card? The last time this happened, that's what the problem was.
E.unmountSD()
I'm pretty surprised appendFile gives you trouble though - that should have written everything to the SD card and closed the file.
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Can you try calling
E.unmountSD()
before you remove the card? The last time this happened, that's what the problem was.I'm pretty surprised appendFile gives you trouble though - that should have written everything to the SD card and closed the file.