audiocogs / opus.js

An Opus audio decoder for aurora.js ported using emscripten
61 stars 15 forks source link

error when using with browserify #4

Open sombriks opened 7 years ago

sombriks commented 7 years ago

i've installed av and opus.js:

"av": "^0.4.9",
"opus.js": "^0.1.1",

however when i try to play it in browser i get the following error:

GET http://192.168.0.105:9966/cordova.js vue.runtime.common.js:6183 You are running Vue in development mode. Make sure to turn on production mode when deploying for production. See more tips at https://vuejs.org/guide/deployment.html restapi.js:6 o serviço está em http://127.0.0.1:3000 libopus.js:1 Uncaught TypeError: Cannot read property 'match' of undefined at Object.staticInit (libopus.js:1) at Object. (libopus.js:1) at Object.162._process (libopus.js:28) at s (_prelude.js:1) at _prelude.js:1 at Object.164.../build/libopus (decoder.js:2) at s (_prelude.js:1) at _prelude.js:1 at Object.163../src/decoder (index.js:1) at s (_prelude.js:1) staticInit @ libopus.js:1 (anonymous) @ libopus.js:1 162._process @ libopus.js:28 s @ _prelude.js:1 (anonymous) @ _prelude.js:1 164.../build/libopus @ decoder.js:2 s @ _prelude.js:1 (anonymous) @ _prelude.js:1 163../src/decoder @ index.js:1 s @ _prelude.js:1 (anonymous) @ _prelude.js:1 221.av @ opusplayer.js:3 s @ _prelude.js:1 (anonymous) @ _prelude.js:1 (anonymous) @ detalhemidia.vue?24694260:21 229.../../components/opusplayer @ detalhemidia.vue?24694260:47 s @ _prelude.js:1 (anonymous) @ _prelude.js:1 216.../features/config/doar.vue @ appcore.js:39 s @ _prelude.js:1 (anonymous) @ _prelude.js:1 234../components/appcore @ main.js:4 s @ _prelude.js:1 e @ _prelude.js:1 (anonymous) @ _prelude.js:1 backend.js:1 [vue-devtools] Ready. Detected Vue v2.1.10

any help/guidance is welcome.

Kukunin commented 6 years ago

Have the same problem

Kukunin commented 6 years ago

I use webpack for building. The problem that it includes process polyfill by default, and compiled JS thinks it's Node. Was able to get a successful build with the following configuration:

    externals: {
      fs: true
    },
    node: {
      process: false,
      Buffer: false,
      setImmediate: false
    },
    resolve: {
      aliasFields: ['browser']
    },
sombriks commented 6 years ago

@Kukunin thank you! i'll check it and see if my build get back on track with this new info!