Firebase Admin SDK ERROR: Expression has type `void`. Put it on its own line as a statement

This is a bit late, but in case others run into this issue, the problem is that res.redirect does not return a value, so it's return type is defined as void.

The error is because the return statement expects a value. You cannot return void. Thus, the TypeScript compiler is viewing return res.redirect(303, snapshot.ref.toString()); as return void, which is what generates the error.

The solution is to put the return on the next line:

res.redirect(303, snapshot.ref.toString());
return;

Unfortunately, while it is invalid TypeScript, best practice is to always put a return before code that finalizes a response, so it doesn't fall through to the rest of the code in a function.

Putting the return on the next line is easy to forget, and easy to miss when scanning code. The return with the response finalization makes it clear the processing is done.

You can disable this by disabling the no-void-expression linting rule, but that is not recommended, since it's a useful rule in general.