Solc Error in browser

i am trying to compile smart contract in react app with solc but it gives me this error:

Code is copied from their github documentation:

const compileContract = async() => {
        var solc = require('solc');        
        var input = {
          language: 'Solidity',
          sources: {
            'test.sol': {
              content: 'contract C { function f() public { } }'
        var output = JSON.parse(solc.compile(JSON.stringify(input)));
        // `output` here contains the JSON output as specified in the documentation
        for (var contractName in output.contracts['test.sol']) {
            contractName +
              ': ' +

did you try to search that error on google?

Yes but I dont get it what is wrong…none of my code uses wasm, maybe solc library does. There has already been this issue but it has not been solved:

I was looking into and found this -

It is the same error I guess which you are facing @2Tijan7N

Also, I didn’t knew about web workers until now, but a quick google search led me to this -

1 Like

Thanks @gat786 :raised_hands:

1 Like