-
Notifications
You must be signed in to change notification settings - Fork 791
Open
Labels
Description
I'm trying to add grpc-web client into a Sveltekit-based application. Here's the page load function (in Typescript, if that matters)
export const load: PageLoad = async ({ fetch, url }) => {
const client = new MetaServiceClient("http://localhost:9000")
const r = await client.list(new MetaListRequest(), null)
console.log(r)
return {
ok: true
}
};
And the output is
4:46:58 AM [vite] Error when evaluating SSR module /src/lib/grpc/service_pb.js:
|- ReferenceError: require is not defined
at eval (/home/noom/mangaweb3-frontend/src/lib/grpc/service_pb.js:15:12)
at instantiateModule (file:///home/noom/mangaweb3-frontend/node_modules/vite/dist/node/chunks/dep-df561101.js:55974:15)
where service_pb.js
is the generated js file.
AndiDog, lombare and jaffyyyy