one icon indicating copy to clipboard operation
one copied to clipboard

[SSR] `.web.tsx` extensions do not appear to take precedence over `.tsx` on web when importing from another package in monorepo

Open kzlar opened this issue 1 year ago • 3 comments

I have a takeout-like monorepo setup where I added apps/one to slowly migrate to one. That means most of my cross platform code lives under packages/app. I have quite a lot of legacy code with .web.tsx extensions, and it seems like during SSR, one does not take those files, and instead take the fallback .tsx files.

kzlar avatar Dec 16 '24 19:12 kzlar

can you try including in deps config? or optimizeDeps.include array? ive struggled with this in Vite quite a bit, will have to set up a repro at some point

natew avatar Jan 01 '25 12:01 natew

Are platform extensions handled by vxrn or does one implement it?

nandorojo avatar Jan 15 '25 15:01 nandorojo

vxrn should handle it, but one adds quite a bit of extra compat with the deps scanning stuff. that said, this could definitely all be worked into vxrn as various options, its just a matter of will to refactor it.

have a fix here, not happy with adding extra overhead here but its only in dev mode for now and only files not in node modules:

https://github.com/onejs/one/pull/448

natew avatar Jan 24 '25 22:01 natew

Can you retry - we've landed some improvements here.

natew avatar Aug 14 '25 19:08 natew