CORS Access Control Error Svelte Kit

Hey, I've been trying to do a fetch request on the client instead of the server, I'm hosting a static svelte site on gh pages, so I need to do things on the client. But calling these methods on the client give these errors above. Here is my code:
 $effect( () => {
        GetFindPackages( "" ).then((res) => {
            if ( !res ) return;
            packages = res;
        });
    })


export const GetFindPackages = async function (query: string): Promise<SboxPackage[] | null> {
    let res = await fetch("https://services.facepunch.com/sbox/package/find");

    if (!res.ok) {
        return null;
    }

    let body = await res.json();
    
    let pkgs: SboxPackage[] = body.Packages;

    return pkgs;
}
image.png
Was this page helpful?