I am new to esBuild and ReactJS and following a guid I decided to building a custom CLI Transpiling application. I got to the point that I am entering a text in textarea but on the console in the client the following error message came out Host version "0.8.27" does not match binary version "0.9.0". I know that I am using an older version, I did try to find a way to resolve the problem first with going trough the documentation since they have completly throw away the startService() method on the new version. But I couldn't find any possible solution to my problem, is there someone with the knowledge to help me solve the problem. Here is my code which has to start the transpiling:
const startService = async () => {
ref.current = await esbuild.startService({
worker: true,
wasmURL: '/esbuild.wasm'
})
}
useEffect(() => {
startService()
}, [])
const onClick = async () => {
if (!ref.current) {
return;
}
const result = await ref.current.build({
entryPoints: ['index.js'],
bundle: true,
write: false,
plugins: [unpkgPathPlugin()]
})
console.log(result );
setCode(result)
}