Repository navigation
feat(ts): let oj defer and log Cloudflare apps under ts_dev_server - #374
Merged
Merged
Conversation
oj's TanStack Start dev server defers the client bundle until it listens only when its --config file's text names @cloudflare/vite-plugin, and the generated config reached the plugin through vite_config's import alone, so a Cloudflare app bundled its whole client before binding. oj also resolves the config its plugins see at logLevel 'silent', which dropped the Worker's console and uncaught errors. ts_dev_server(cloudflare = True) names the plugin in the generated config and sets a stdout/stderr customLogger. Gazelle sets the attribute when the target's vite_config, or a vite.config.* it names, names the plugin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mikn
force-pushed
the
mikn/ts-dev-server-cloudflare-marker
branch
from
October 28, 2026 14:15
dffc15b to
364f895
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As of 2026-10-28, a large TanStack Start + Cloudflare app under
ts_dev_serveron oj 0.2.49 takes about 300 s to listen, or never listens within 340 s, and its Worker errors are lost. oj defers the client bundle only when the--configfile's text names@cloudflare/vite-plugin, and the generated config reaches the plugin through an import alone.cloudflareattr onts_dev_server, which requiresvite_config. The generated config names the plugin and sets a stdout/stderrcustomLogger. Gazelle sets the attr whenvite_config, or avite.config.*it names, names the plugin.Why a logger
oj resolves its plugins' config at
logLevel: 'silent', so the Cloudflare plugin's Miniflare logger dropped the Worker'sconsole.error, warnings and uncaught exceptions. Vite'screateLoggerreturns acustomLoggerunchanged, so setting one bypasses the silent level. Every plugin's info lines print as well, unfiltered bylogLevel.Observed in production: no; dev-server only, found by a dev-server route test.
Gain: listen at about 170 s instead of 300 s or never; Worker errors visible.
Tests
TestDevServer_CloudflareFollowsTheViteConfig(one table test, Gazelle convergence): the plugin named invite_configsets the attr, so does avite.config.tsit loads, and an unloaded one removes it.TestCloudflareConfigNamesThePluginForOj(unit): the config contains the string oj searches for.TestCloudflareConfigLogsWorkerErrors(unit): the evaluated config'scustomLogger.errorwrites to stderr.🤖 Generated with Claude Code