2

I'm getting error when trying start SSR and import { AudioContext } from standardized-audio-context

/workspace/node_modules/async-array-buffer/build/es5/bundle.js:10
    var blob = new Blob([worker], {
               ^

ReferenceError: Blob is not defined
    at /workspace/node_modules/async-array-buffer/build/es5/bundle.js:10:13
    at /workspace/node_modules/async-array-buffer/build/es5/bundle.js:2:65
    at Object.<anonymous> (/workspace/node_modules/async-array-buffer/build/es5/bundle.js:5:2)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._compile (/workspace/node_modules/pirates/lib/index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.newLoader [as .js] (/workspace/node_modules/pirates/lib/index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error Command failed with exit code 1.

How to possible to fix and where i need start to dig?

1

1 Answer 1

1

First of all, install the below package

-> npm install blob-polyfill

After that go to server.ts file, make an import and add blob to global.

-> import { Blob } from 'blob-polyfill'

-> global['Blob'] = Blob

I guess now you are all set to go.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.