I'm using a +server.ts file to mask the path to a Netlify function. While the redirect and the function both work, I still get to see a console error, e.g. when clicking on a link to /download?get=filename.
Error: Not found: /download/
Here's the code for the server component.
// routes/download/+server.ts
import type { RequestHandler } from '@sveltejs/kit';
export const GET: RequestHandler = async () => {
const options: ResponseInit = {
status: 302,
headers: {
location: '/.netlify/functions/download'
}
};
return new Response(null, options);
};
I'd love to get rid of the client error, but I'm not sure what causes this.