Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transforms do not seem to process files passed to the --require option #855

Closed
davidbonnet opened this issue Aug 9, 2014 · 5 comments
Closed

Comments

@davidbonnet
Copy link

This bug only happens with browserify@5.x.x. It works fine on browserify@4.x.x.

Say I have a simple CoffeeScript file script.coffee. If I use browserify to compile it:

browserify --extension=.coffee -t coffeeify -t [ envify --JS_ENV browser ] --no-builtins --require script.coffee:module > script.js

It outputs an error that looks like it tried to parse CoffeeScript as JavaScript:

SyntaxError: Line 2: Unexpected token ILLEGAL while parsing script.coffee while parsing file: script.coffee
at Stream.end (browserify/node_modules/insert-module-globals/index.js:72:21)
at _end (node_modules/browserify/node_modules/insert-module-globals/node_modules/through/index.js:65:9)
at Stream.stream.end (node_modules/browserify/node_modules/insert-module-globals/node_modules/through/index.js:74:5)
at Transform.onend (node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js:505:10)
at Transform.g (events.js:180:16)
at Transform.EventEmitter.emit (events.js:117:20)
at node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js:942:16
at process._tickCallback (node.js:415:13)

It works fine though if I compile it without the --require option:

browserify --extension=.coffee -t coffeeify -t [ envify --JS_ENV browser ] --no-builtins script.coffee > script.js

…making me believe that the transforms are not applied to files passed to the --require option.

@davidbonnet
Copy link
Author

This issue might be related to #840.

@klaemo
Copy link

klaemo commented Aug 28, 2014

I can't give any valuable input, but confirm this bug with browserify 5.

@bjmiller
Copy link

bjmiller commented Oct 7, 2014

Actually, I think it's this: jnordberg/coffeeify#13
It's something that @substack and @jnordberg should work out together. If you use the terms "global" or "process" anywhere in your code, including comments, you get this error.

@ghost
Copy link

ghost commented Oct 8, 2014

Should be fixed in 6.0.3.

@ghost ghost closed this as completed Oct 8, 2014
@bjmiller
Copy link

This is now working properly. Thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants