Eoli-an / REAM

https://ream-six.vercel.app
0 stars 0 forks source link

Jieba Load Vercel #30

Open Eoli-an opened 2 months ago

Eoli-an commented 2 months ago

Due to bundling, fs reads are hard to do on vercel. My current solution now is // try { // const response = await fetch('/dict.txt.big'); // Adjust the path if necessary // const dictText = await response.text(); // const dictBuffer = Buffer.from(dictText); // loadDict(dictBuffer); // } catch (err) { // console.error('Error loading dictionary:', err); // }

However: I get an error in the fetch I use not sure if the place in the hooks is the best as the startup time is higher then?

Eoli-an commented 2 months ago

https://stackoverflow.com/questions/69418568/how-to-execute-code-on-sveltekit-app-start-up/76505892#76505892

Eoli-an commented 2 months ago

https://kit.svelte.dev/docs/hooks#server-hooks

Eoli-an commented 2 months ago

https://github.com/sveltejs/kit/issues/3535

Eoli-an commented 2 months ago

https://github.com/sveltejs/kit/issues/5163