dominictarr / JSONStream

rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)
Other
1.92k stars 165 forks source link

Browserify throws an error because of #! /usr/bin/env node #73

Closed ArtskydJ closed 9 years ago

ArtskydJ commented 9 years ago

The first line of index.js, #! /usr/bin/env node, causes browserify to throw an error when using brfs.

C:\Users\Michael\Github\javascript\convert-and-seed-audio>browserify node_modules/JSONStream -t brfs -o deleteme.js
SyntaxError: Unexpected character '#' (1:0)
    at Parser.pp.raise (C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\node_modules\falafel\node_modules\acorn\dist\acorn.js:1745:13)
    at Parser.pp.getTokenFromCode (C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\node_modules\falafel\node_modules\acorn\dist\acorn.js:3486:8)
    at Parser.pp.readToken (C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\node_modules\falafel\node_modules\acorn\dist\acorn.js:3189:15)
    at Parser.pp.nextToken (C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\node_modules\falafel\node_modules\acorn\dist\acorn.js:3181:71)
    at parse (C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\node_modules\falafel\node_modules\acorn\dist\acorn.js:100:5)
    at module.exports (C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\node_modules\falafel\index.js:22:15)
    at C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\index.js:37:23
    at ConcatStream.<anonymous> (C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\node_modules\concat-stream\index.js:36:43)
    at ConcatStream.emit (events.js:129:20)
    at finishMaybe (C:\Users\Michael\Github\javascript\convert-and-seed-audio\node_modules\brfs\node_modules\static-module\node_modules\concat-stream\node_modules\readable-stream\lib\_stream_writable.js:460:14)

C:\Users\Michael\Github\javascript\convert-and-seed-audio>browserify node_modules/JSONStream -o deleteme.js

C:\Users\Michael\Github\javascript\convert-and-seed-audio>

Moving the CLI to a separate file, or just deleting the line should fix the issue.

dominictarr commented 9 years ago

oh this is bug in browserify. browserify's aim is to provide node on the browser, to it should theirfore handle this. I think i remember fixing this bug in browserify. what version are you using?

ArtskydJ commented 9 years ago

I was using browserify@4.2.0, so I updated to browserify@10.2.6. The build still fails due to brfs.

Since this is not an issue with JSONStream, I'm closing this issue and opening an issue on brfs.

dominictarr commented 9 years ago

:+1: for open source!