Make sure the file where you're calling let stream = await renderToStream(<TestPDF message={message} />) has the .tsx extension. If the file has a .ts extension, you’ll get the error: 'TestPDF' refers to a value, but is being used as a type here. Did you mean 'typeof TestPDF'?
As a rule of thumb: