landau / hapi-react

Render hapi views
MIT License
64 stars 3 forks source link

question : why does this not work #3

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hello,

Im trying to follow this tutorial : http://facebook.github.io/react/docs/tutorial.html But when I run it , I see this error message :

transforming /home/action/workspace/hapi_ecommerce/templates/about_us.jsx to JSX: Error: Parse Error: Line 14: Unexpected token :: Error transforming /home/action/workspace/hapi_ecommerce/templates/about_us.jsx to JSX: Error: Parse Error: Line 14: Unexpecte
d token : 

My code can be found here : https://github.com/roelof1967/hapi_ecommerce

landau commented 9 years ago

You're using the engine incorrectly. Whatever template reply.view is called on must export a React class.

https://github.com/roelof1967/hapi_ecommerce/blob/master/templates/about_us.jsx is html.

See: https://github.com/landau/hapi-react/blob/master/fixtures/hi.jsx

ghost commented 9 years ago

changed it as you said but still the same error.

landau commented 9 years ago

Hard to say what the problem is without seeing code. I've used this in production code used in the same fashion as your hapi server

ghost commented 9 years ago

I will give you the code again. The code can be found here : https://github.com/roelof1967/hapi_ecommerce

landau commented 9 years ago

Hmm. I don't see any view code at all now.