You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to upgrade Remix to latest one, which uses vite plugin. Upgrade fail with error:
Server-only module referenced by client
'./sessions.server' imported by route 'src/root.tsx'
Remix automatically removes server-code from these exports:
`loader`, `action`, `headers`
But other route exports in 'src/root.tsx' depend on './sessions.server'.
exports from ./sessions.server is used inside root loader
old remix version was able to handle this and was not bundling server code to client
but newer one is not able to do so
I have tried creating a vite plugin to resolve .server.ts file for client side code as empty module.
It didn't helped
Reproduction
I'm trying to upgrade Remix to latest one, which uses vite plugin. Upgrade fail with error:
exports from ./sessions.server is used inside root loader
old remix version was able to handle this and was not bundling server code to client
but newer one is not able to do so
I have tried creating a vite plugin to resolve .server.ts file for client side code as empty module.
It didn't helped
System Info
Used Package Manager
yarn
Expected Behavior
This should not throw error and handle it like old remix was doing.
Actual Behavior
It throws error mentioned above.
The text was updated successfully, but these errors were encountered: