local compiler should be loaded without worker

pull/1892/head
aniket-engg 3 years ago
parent 629d34f5ef
commit f103e5567b
  1. 7
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx

@ -356,12 +356,13 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
return console.log('loading ' + selectedVersion + ' not allowed, version should start with "soljson"') return console.log('loading ' + selectedVersion + ' not allowed, version should start with "soljson"')
} }
} }
// Workers cannot load js on "file:"-URLs and we get a // Workers cannot load js on "file:"-URLs and we get a
// "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium, // "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium,
// resort to non-worker version in that case. // resort to non-worker version in that case.
if (selectedVersion === 'builtin') selectedVersion = state.defaultVersion if (selectedVersion === 'builtin') {
if (selectedVersion !== 'builtin' && canUseWorker(selectedVersion)) { selectedVersion = state.defaultVersion
compileTabLogic.compiler.loadVersion(false, url)
} else if (canUseWorker(selectedVersion)) {
compileTabLogic.compiler.loadVersion(true, url) compileTabLogic.compiler.loadVersion(true, url)
} else { } else {
compileTabLogic.compiler.loadVersion(false, url) compileTabLogic.compiler.loadVersion(false, url)

Loading…
Cancel
Save