title: WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB
body: <p>I'm trying out a simple hello world WebAssembly example and I'm having trouble understanding an error I'm seeing in Chrome 59:</p>
  
  <blockquote>
    <p>RangeError: WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread.</p>
  </blockquote>
  
  <pre><code>src/wasm/counter.wasm:13
    10 | let wa;
    11 | const make = source =&gt; {
    12 |   // buffer should already be set
  &gt; 13 |   return wa = new Module(buffer);
    14 | };
    15 | 
    16 | const WebAssemblyModule = function(deps = {
  </code></pre>
  
  <p>I've followed the steps in <a href="https://blog.openbloc.fr/webassembly-first-steps/" rel="noreferrer">this tutorial</a>, and I can build everything without error. I'm using <code>create-react-app</code> <a href="https://github.com/ballercat/wasm-loader/issues/3" rel="noreferrer">rewired with <code>wasm-loader</code></a>.</p>
  
  <p>If I'm using my local build of the counter module I get the error I mentioned in the beginning. If I try and use a pre-built version (for example the one <a href="https://github.com/jaydson/wasm-test" rel="noreferrer">in this project</a>) it works fine.</p>
  
  <p>When I build my module, I'm using the same command as specified in the tutorial. The project with the working module has the same command listed in its README:</p>
  
  <pre><code>emcc counter.c -O1 -o counter.wasm -s WASM=1 -s SIDE_MODULE=1
  </code></pre>
  
  <p>Any idea what might be causing the error?</p>