node-jsx
node-jsx copied to clipboard
Parse Error: Illegal return statement
Added require('node-jsx').install()
to my app and getting Illegal return statement
when it tries to parse node libs under node_modules/.
I'm guessing { extension: '.jsx' }
fixes it but I don't think this should happen.
What's up?
Error: Error transforming /project/node_modules/express/node_modules/methods/index.js to JSX: Error: Parse Error: Line 9: Illegal return statement
express/node_modules/methods/index.js
var http = require('http');
if (http.METHODS) {
module.exports = http.METHODS.map(function(method){
return method.toLowerCase();
});
return;
}
Getting the same thing
Error transforming /Users/buie/Sites/fifa-heroes/node_modules/browserify-middleware/node_modules/browserify/node_modules/module-deps/node_modules/parents/node_modules/path-platform/path.js to JSX: Error: Parse Error: Line 29: Illegal return statement`
Is the default behavior to parse any .js file in the project into .jsx? Doesn't seem like an obvious expectation.
Getting the same with the BrowserSync module:
Error: Error transforming [app]/node_modules/browser-sync/index.js to JSX: Error: Parse Error: Line 1: Unexpected token ILLEGAL
Triggered by this line in that file: #! /usr/bin/env node
Might be nice to be able to exclude certain folders, like node_modules for example.
+1