Hi there!
This is actually an issue I’ve had in the past with Gatsby as well. It happens because Gatsby is unable to serve static html files in development mode.
There is an open ticket you can view in the Gatsby repo here, and you can view a workaround that I actually posted a little while ago here.
Basically you just need to find another way to serve the PDF.js Express files in development mode.
Thank you,
Logan