Skip to content

feat(cloudflare): run vite dev servers in child processes - #1076

Merged
sam-goodwin merged 2 commits into
mainfrom
fix/vite-child-process
Aug 4, 2026
Merged

sam-goodwin merged 2 commits into
mainfrom
fix/vite-child-process

Conversation

@BlankParticle

@BlankParticle BlankParticle commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

run vite server in child process to make sure everything that relies on process.cwd() gets correct cwd, also capture logs from processes and add [worker] | prefix to logs
Screenshot 2026-08-04 at 15-24-58

fixes #1014
fixes #1019

vite side bug fix for server.port vitejs/vite#23158

@alchemy-version-bot

alchemy-version-bot Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

alchemy

bun add alchemy@https://pkg.ing/alchemy/94df145

@alchemy.run/better-auth

bun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/94df145

@alchemy.run/pr-package

bun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/94df145

@BlankParticle BlankParticle changed the title fix(cloudflare): run vite dev servers in child processes feat(cloudflare): run vite dev servers in child processes Aug 4, 2026
Comment on lines +100 to +101
Effect.provide(RpcServerEnvironment.fromEnv()),
Effect.provide(PlatformServices),

@sam-goodwin sam-goodwin Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never use two susbsequent Effect.provide.

Always Effect.provide(RpcServerEnvironment.fromEnv().pipe(Layer.provideMerge(PlatformService)))

If RpcServerEnvironment doe not depend on PlatformService, then just do Effect.provide([RpcServerEnvironment.fromEnv(), PlatformService])

Comment on lines +89 to +93
yield* Effect.sync(() => {
process.stdout.write(
`${VITE_CHILD_READY_PREFIX}${url}${VITE_CHILD_READY_SUFFIX}\n`,
);
});

@sam-goodwin sam-goodwin Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be:

yield* Console.log(`${VITE_CHILD_READY_PREFIX}${url}${VITE_CHILD_READY_SUFFIX}`)

@sam-goodwin
sam-goodwin merged commit 861589f into main Aug 4, 2026
4 checks passed
@sam-goodwin
sam-goodwin deleted the fix/vite-child-process branch August 4, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants