solid icon indicating copy to clipboard operation
solid copied to clipboard

JSXFragment / jsx-dom-expressions

Open iamjohnlong opened this issue 8 years ago • 4 comments

I'm trying to set up a codesandbox to play around with solid.

I'm getting

You gave us a visitor for the node type "JSXFragment" but it's not a valid type

https://codesandbox.io/s/rwvlplp084

Can you help get a template/sandbox working? Thanks!

iamjohnlong avatar Sep 08 '18 18:09 iamjohnlong

I've seen this error before on older versions of Babel. Pre Babel 7 JSX Fragment elements weren't supported. I haven't used codesandbox before but looking at dependencies I don't see where Babel is being imported. I suspect it is using Babel 6 or even one of the earlier versions of 7 beta. I developed this on the beta. However version 7 was released 10 days ago. It's possible 3rd party software hasn't updated to 7 yet.

If explicitly setting the babel dependencies is an option I imagine that should get past this. I probably should add this to the Readme.

ryansolid avatar Sep 08 '18 22:09 ryansolid

Yeah I thought it could be a babel version issue. I will stop being lazy and set it up locally and let you know if I have the same issue.

iamjohnlong avatar Sep 08 '18 23:09 iamjohnlong

I created repo with everything working here https://github.com/iamjohnlong/webpack-solid

The only issue I have is needing to set r in the window here https://github.com/iamjohnlong/webpack-solid/blob/master/src/index.js#L4

iamjohnlong avatar Sep 09 '18 17:09 iamjohnlong

Hmm.. I haven't seen that in my projects. Maybe because there is no reference in the initial build it's being skipped by webpack but I use Webpack 4 as well. I wouldn't expect needing to set it on window. I wonder if any reference would keep it in scope. I will take a look when I have some time to see if I can puzzle why it happens.

ryansolid avatar Sep 12 '18 01:09 ryansolid