Hi @elringus , I have an issue with backing the bootsharp (latest version 0.7) generated npm package into the project with an old build pipeline. My app build was failing with Can't resolve fs/promises message.
I've fixed it with patching package single line: Under generated buildConfig function,
async function fetchBuffer(res) {
const path = `${root}/${res.name}`;
if (typeof window === "object")
return (await fetch(path)).arrayBuffer();
if (typeof process === "object") {
const { readFile } = await import(/* webpackIgnore: true */ 'fs/promises'); // <-- this one
const bin = await readFile(path);
return bin.buffer.slice(bin.byteOffset, bin.byteOffset + bin.byteLength);
}
throw Error(`Failed to fetch '${path}' boot resource: unsupported runtime.`);
}
I'm not sure, either /*@vite-ignore*/ should be added as well (probably not), so I'm opening an issue, not a PR 🙂
Hi @elringus , I have an issue with backing the bootsharp (latest version 0.7) generated npm package into the project with an old build pipeline. My app build was failing with
Can't resolve fs/promisesmessage.I've fixed it with patching package single line: Under generated
buildConfigfunction,I'm not sure, either
/*@vite-ignore*/should be added as well (probably not), so I'm opening an issue, not a PR 🙂