solidjs / solid-start

SolidStart, the Solid app framework
https://start.solidjs.com
MIT License
5.18k stars 375 forks source link

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

Closed oscartbeaumont closed 1 year ago

oscartbeaumont commented 1 year ago

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!

ryansolid commented 1 year ago

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

oscartbeaumont commented 1 year ago

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.

ryansolid commented 1 year ago

I'm already tracking this issue. So closing.