@@ -109,7 +109,15 @@ export async function convertToConfigBundle(
109109 initialPort : undefined ,
110110 initialIp : "127.0.0.1" ,
111111 rules : [ ] ,
112- inspectorPort : 0 ,
112+ ...( event . config . dev . inspector === false
113+ ? {
114+ inspect : false ,
115+ inspectorPort : undefined ,
116+ }
117+ : {
118+ inspect : true ,
119+ inspectorPort : 0 ,
120+ } ) ,
113121 localPersistencePath : event . config . dev . persist ,
114122 liveReload : event . config . dev ?. liveReload ?? false ,
115123 crons,
@@ -119,7 +127,6 @@ export async function convertToConfigBundle(
119127 httpsKeyPath : event . config . dev ?. server ?. httpsKeyPath ,
120128 localUpstream : event . config . dev ?. origin ?. hostname ,
121129 upstreamProtocol : event . config . dev ?. origin ?. secure ? "https" : "http" ,
122- inspect : true ,
123130 services : bindings . services ,
124131 serviceBindings : fetchers ,
125132 bindVectorizeToProd : event . config . dev ?. bindVectorizeToProd ?? false ,
@@ -204,7 +211,13 @@ export class LocalRuntimeController extends RuntimeController {
204211 // `inspectorUrl` for this set of `options`, we protect `#mf` with a mutex,
205212 // so only one update can happen at a time.
206213 const userWorkerUrl = await this . #mf. ready ;
207- const userWorkerInspectorUrl = await this . #mf. getInspectorURL ( ) ;
214+ // TODO: Miniflare should itself return undefined on
215+ // `getInspectorURL` when no inspector is in use
216+ // (currently the function just hangs)
217+ const userWorkerInspectorUrl =
218+ options . inspectorPort === undefined
219+ ? undefined
220+ : await this . #mf. getInspectorURL ( ) ;
208221 // If we received a new `bundleComplete` event before we were able to
209222 // dispatch a `reloadComplete` for this bundle, ignore this bundle.
210223 if ( id !== this . #currentBundleId) {
@@ -228,12 +241,16 @@ export class LocalRuntimeController extends RuntimeController {
228241 hostname : userWorkerUrl . hostname ,
229242 port : userWorkerUrl . port ,
230243 } ,
231- userWorkerInspectorUrl : {
232- protocol : userWorkerInspectorUrl . protocol ,
233- hostname : userWorkerInspectorUrl . hostname ,
234- port : userWorkerInspectorUrl . port ,
235- pathname : `/core:user:${ getName ( data . config ) } ` ,
236- } ,
244+ ...( userWorkerInspectorUrl
245+ ? {
246+ userWorkerInspectorUrl : {
247+ protocol : userWorkerInspectorUrl . protocol ,
248+ hostname : userWorkerInspectorUrl . hostname ,
249+ port : userWorkerInspectorUrl . port ,
250+ pathname : `/core:user:${ getName ( data . config ) } ` ,
251+ } ,
252+ }
253+ : { } ) ,
237254 userWorkerInnerUrlOverrides : {
238255 protocol : data . config ?. dev ?. origin ?. secure ? "https:" : "http:" ,
239256 hostname : data . config ?. dev ?. origin ?. hostname ,
0 commit comments