zhuker / lamejs

mp3 encoder in javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught ReferenceError: Lame is not defined

bsidoruk opened this issue · comments

I have this library as a dependency in an Electron app. If I serve the app using a local server it works fine, however if I build the app I get the error Uncaught ReferenceError: Lame is not defined when I launch it. This seems related to #58, however that doesn't seem to have really been resolved.

here is a sample project that works for me

package.json

{
  "name": "myproj",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
	  "lamejs": "1.2.0"
  }
}

index.js

lame = require("lamejs")
encoder = new lame.Mp3Encoder(1, 48000,128)
console.log(encoder)

i run

  1. npm install
  2. node index.js

expected output:

Mp3Encoder { encodeBuffer: [Function], flush: [Function] }

let me know if it works for you
if it does - look into your build system

@bsidoruk I have the same problem... Did you resolve problem?

same problem here

@zhuker I have the same problem (in the browser when building with Parcel 2.0.1) and #59 would very likely resolve it. Could you consider merging it, or should I make a new pull-request?

@eibens do you have steps to reproduce?
that would make me more confident about merging

@zhuker Hi, thanks for the quick reply. See this repository. The readme contains more info.

@zhuker Hi, thanks for the quick reply. See this repository. The readme contains more info.

merged #59

creating a new npm release

Amazing! Thanks so much for resolving this so quickly.