Using the remix bundler, that was separated just fine. Using the vite bundler, it isn't. And it doesn't give me a nice stack trace either, it just mentioned "Module "stream" has been externalized" as warning in browser console in dev mode, while causing hard issues in production.
Comments
Their client/server separation became a lot more precise with Vite. I had a lot of server code leaking into the client in the old remix bundler that became aparent on Vite 😅
Jokes aside, I feel your pain, had the same issues when moving from their old compiler to Vite, what I can say from my vast experience with their Vite plugin is that it gets MUCH better from here.
Also, make it a LOT easier to trace down these things. This is a PITA and has me concerned for the future.
I'm really surprised you had that happen to you after the migration
I remember chunk-based streaming not being supported on AWS Lambda; honestly, stepping away from that would be great.
Here's the relevant part that encodes the stream I believe:
https://github.com/jacob-ebey/turbo-stream/blob/main/src/turbo-stream.ts#L188
https://remix.run/docs/en/main/discussion/server-vs-client#splitting-up-client-and-server-code