-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webpack+JSX + generators: Did not recognize object of type "JSXElement" #930
Comments
I just created a pull request for ast-types: benjamn/ast-types#93 . I assume that something sets a custom parser (acorn-babel ?) which doesn't produce XJS* nodes anymore. |
@Naddiseo I've had some problems with your code but I have something I have to ask.
output
I am sorry if you know this and does not fit your needs and I am just wasting your time. I'll look into your gist again later. However, from quick look:
This might be problem when XJS/JSX is solved: you need something to replace this:
Array or single item should be here. You do not return anything to JSX. Maybe something like this:
|
@fkling That PR to ast-types does fix my problem, I guess my intuition was right. @neVERberleRfellerER, I didn't know about the /** jsx */ thing until this morning, but it doesn't apply since I wanted to pre-compile the output anyway. I guess this can be closed once the ast-types dependency has been updated. |
Fixed as of 4.7.0, thanks! |
I have my own custom JSX transformer based upon the react one, except that its output it pre-compiled into the mithril's output format:
{ "tag": "TAG", "attrs", {}, "children": [] }
If in the same file I have a generator function I'm getting the following build error:
If I remove the generator, it works fine. I've tried stepping through with node-debug and as far as I can tell, my loader is called and properly transforms the code, so I think there may be a conflict somewhere in the regenerator transforms. My intuition is because regenerator/ast-types uses
XJS*
whereas babel usesJSX*
for the ast tags.I've created a gist with my webpack conf, a test file, and my jsx loader/transformer: https://gist.github.com/Naddiseo/800aab5c780d9440ba70
The text was updated successfully, but these errors were encountered: