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

Parse Error: Illegal return statement #16

Open
raine opened this issue Aug 16, 2014 · 3 comments
Open

Parse Error: Illegal return statement #16

raine opened this issue Aug 16, 2014 · 3 comments

Comments

@raine
Copy link

raine commented Aug 16, 2014

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;
}
@ryanblakeley
Copy link

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.

@benoneal
Copy link

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.

@codemeasandwich
Copy link

+1

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

No branches or pull requests

4 participants