Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSC: runFeServer: wrap RSC code with if (rscEnabled) #10105

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions packages/vite/src/runFeServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,15 @@ export async function runFeServer() {
const app = express()
const rwPaths = getPaths()
const rwConfig = getConfig()

const rscEnabled = rwConfig.experimental?.rsc?.enabled

registerFwGlobals()

try {
// This will fail if we're not running in RSC mode (i.e. for Streaming SSR)
// TODO (RSC) Remove the try/catch, or at least the if-statement in there
// once RSC is always enabled
await setClientEntries('load')
} catch (e) {
if (rscEnabled) {
if (rscEnabled) {
try {
// This will fail if we're not running in RSC mode (i.e. for Streaming SSR)
await setClientEntries('load')
} catch (e) {
console.error('Failed to load client entries')
console.error(e)
process.exit(1)
Expand Down
Loading