solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

`createServerData$`'s are running on the client in certain circumstances

Open oscartbeaumont opened this issue 3 years ago • 2 comments

If my understanding is correct under no circumstance createServerData$ should be executed on the client but under a few conditions, I have been able to make it do that. I have been able to isolate the problems and have put them into this demonstration repository here.

It seems to be coming down to having a createServerData$ being defined in a utility file outside of the current page but I don't know enough about the internals of SolidJS to draw any conclusion or know how to help fix this.

Thanks for your time, I have been loving SolidStart!

oscartbeaumont avatar Nov 28 '22 08:11 oscartbeaumont

I think we are only transforming .jsx/.tsx files right now which is the issue here.

ryansolid avatar Nov 28 '22 10:11 ryansolid

Renaming the file to tsx fixed it, thanks.

I definitely think ts and js should be added given I think that is going to catch out new users.

It's also a pretty confusing default behavior to just run it on the hook on the client so I also recon an error should be thrown instead.

oscartbeaumont avatar Nov 30 '22 00:11 oscartbeaumont

I'm already tracking this issue. So closing.

ryansolid avatar Dec 22 '22 04:12 ryansolid