devongovett / jpg-stream

A streaming JPEG encoder and decoder
85 stars 14 forks source link

Breaks in Browser due to process #2

Open mattdesl opened 9 years ago

mattdesl commented 9 years ago

The compiled output currently breaks in browserify. Offending line:

Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")

   Uncaught TypeError: Cannot read property 'replace' of undefined

It also relies on other features like process.stdout etc.

devongovett commented 9 years ago

Yeah browserify and emscripten don't get along very well. You need to tell browserify to not parse that file. Unfortunately, I don't have a way to do that at the module level, so every project using jpg-stream (or any other emscripten project) must do that.

browserify --noParse jpg-stream/build/jpeg.js ...
mattdesl commented 9 years ago

Cool, thanks.

Sent from my iPhone

On Mar 3, 2015, at 2:24 PM, Devon Govett notifications@github.com wrote:

Yeah browserify and emscripten don't get along very well. You need to tell browserify to not parse that file. Unfortunately, I don't have a way to do that at the module level, so every project using jpg-stream (or any other emscripten project) must do that.

browserify --noParse jpg-stream/build/jpeg.js ... — Reply to this email directly or view it on GitHub.