petehunt / node-jsx

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

Uncaught TypeError: Cannot set property '.jsx' of undefined #13

Closed devonbl closed 9 years ago

devonbl commented 10 years ago

I know I must be missing something really basic here

I just added

require('node-jsx').install({extension: '.jsx'});

to my index.js and changed some file extensions, but I get this type error during runtime.

pgoldrbx commented 9 years ago

I see this also but only in a file loaded by the browser (using browserify). server-only is ok.

gpbl commented 9 years ago

I guess this module is meant to work only from node. For browserify or webpack you should use reactify or the jsx-loader.

pgoldrbx commented 9 years ago

+1 for reactify w/ browserify. Just have to make sure not to require node-jsx within a shared file. It can be placed at a top-level server-side file though and appears to work for all subsequent files.

jakies commented 9 years ago

+1 for all of you. This solved 2 issues for me.