Closed ericleponner closed 1 year ago
After investigations, it looks like component is crashing on browser.solidity.worker.ts line 15.
I see that importScripts()
is kind of stub : it seems to be ok with vuejs dev environment but not in production. Do I need to provide some code here ?
function browserSolidityCompiler() {
const ctx: Worker = self as any;
ctx.addEventListener('message', ({ data }) => {
if (data === 'fetch-compiler-versions') {
fetch('https://binaries.soliditylang.org/bin/list.json').then(response => response.json()).then(result => {
postMessage(result)
})
} else {
importScripts(data.version); <=== HERE
const soljson = ctx.Module;
if ('_solidity_compile' in soljson) {
const compile = soljson.cwrap('solidity_compile', 'string', ['string', 'number']);
const output = JSON.parse(compile(data.input))
postMessage(output)
}
}
});
}
function importScripts(_arg0: string) {
throw new Error('Function not implemented.');
}
Please refer to vuejs dev tools issue#514
I did not find root cause of the issue. I worked around by writing my own worker using plain javascript. Thanks for helping.
I'm using
browser-solidity-compiler
from a VueJS application.When I run on my local dev environment, everything works fine :
solidityCompiler()
loads and runs the compiler perfectly.However when I deploy my VueJS app on an production host,
solidityCompiler()
throws the following error in navigator console:Have you ever face this kind of issue ? Thanks for any help