minutemailer / react-popup

React popup component
http://minutemailer.github.io/react-popup/
MIT License
208 stars 71 forks source link

Unable to process because index.js has JSX syntax #4

Closed ambujpunn closed 8 years ago

ambujpunn commented 9 years ago

When I try to require react-popup in my file, I get this error:

/node_modules/react-popup/index.js Line 188: Unexpected token < You may need an appropriate loader to handle this file type.

After doing some research online (http://stackoverflow.com/questions/31374451/webpack-with-react-modules-giving-unexpected-token), it looks like there is JSX syntax on line 188 of index.js which is not valid js. Can this be fixed?

tbleckert commented 9 years ago

You need the reactify transformer in your build script. Here's some information about JSX https://facebook.github.io/react/docs/jsx-in-depth.html

Currently all components use JSX syntax. You can use Babel to compile your JS as well which has built in support for JSX. No need for a transformer.

djkirby commented 8 years ago

Shouldn't it be transpiled before being published? Seems odd to require people to run babel through their node_modules.

tbleckert commented 8 years ago

Yes that is absolutely true, sorry I missed. But during this specific issue we didn't use Babel, although the same was probably true in this case with the JSX issue. I will reopen and fix right away, haven't had time to give this one much love unfortunately :(

djkirby commented 8 years ago

Thanks man!