This can happen if there is a problem with the project. Have you tried creating a new project and exporting it again?
In iMovie, make sure you've selected the project only and not any events, then try exporting it.
Let me know if that is successful for you.
Is this happening when you try exporting a new project? Is it happening for all projects?
Is it happening for all projects or just one project? What about an entirely new project?
Ok, then unfortunately something has gotten corrupted within that project, and it will need to be either recovered from a backup if you have made one previously, or recreated.
If you have FCP you can try the following workaround:
Press Command+E to Share as a Master File (default) from FCP, then drop the resulting file into Compressor. Set up your encoding as normal and Submit Batch.