I'm trying to set-up my clojurescript build that's using a js lib with JSX definitions. But this ends up with the following error:
SyntaxError: expected expression, got '<'
<div className="commentBox">
This error is thrown for the compiled/out/components.js
My includes in the HTML are as follows:
<script src="js/compiled/out/react.inc.js"></script>
<script src="js/compiled/out/react-dom.inc.js"></script>
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<script src="http://code.jquery.com/jquery-1.10.0.min.js"> </script>
Apart from that my clojure build is:
{:main uni-stuttgart.ipsm.coact.core
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:foreign-libs [{:file "resources/public/js/libs/components.js"
:provides ["libs.components"]
:preprocess :jsx}]
:source-map-timestamp true
}
And the components.js is:
/**
* @jsx React.DOM
*/
var CommentBox = React.createClass({
render: function() {
return (
<div className="commentBox">
Hello, world! I am a CommentBox.
</div>
);
}
});
Any ideas how to fix this problem?
Regards,
Timur
Have you set up a defmethod js-transforms for :jsx (the value specified in :preprocess)?
- Mike
Hi Mike,
Thanks for the answer.
Nope, is there any documentation about how I integrate it into my cljs build? I saw this one [1], but it requires a separate build setting and execution, I would preferably avoid that.
[1] https://github.com/mneise/circle-color/blob/master/scripts/build.clj
Regards,
Timur
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/idilFfxaUW0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.