petehunt / node-jsx

transparently require() jsx from within node
164 stars 32 forks source link

Transformation fails when it encounters a hashbang #30

Open appsforartists opened 9 years ago

appsforartists commented 9 years ago

If I try to use my-local-ip (which starts with #! /usr/bin/env node), I get this error:

Error: Error transforming /Users/screencasting/Desktop/ambidex-example/node_modules/my-local-ip/index.js to JSX: Error: Parse Error: Line 1: Unexpected token ILLEGAL
    at Object.require.extensions.(anonymous function) [as .js] (/Users/screencasting/Desktop/ambidex-example/node_modules/node-jsx/index.js:24:13)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Ambidex._startServingWebpack (/Users/screencasting/Desktop/ambidex-example/node_modules/Ambidex/src/Ambidex.server.js:601:16)
    at Ambidex._startServing (/Users/screencasting/Desktop/ambidex-example/node_modules/Ambidex/src/Ambidex.server.js:490:12)
    at Ambidex.<anonymous> (/Users/screencasting/Desktop/ambidex-example/node_modules/Ambidex/src/Ambidex.server.js:86:21)

@dominictarr thinks you should have a regex to filter out hashbangs before transformation.