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?
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?