pear-electron cannot load bare-tcp (require.addon) in the renderer. Use pear-run + workers/holesail-local.cjs so the actual holesail package runs under Bare; Node still loads holesail in-process. Add connect fallback modal with copy URL.
This commit is contained in:
+22
-1
@@ -794,7 +794,28 @@ export async function connectLocalTunnel(url, opts = {}) {
|
||||
return entry
|
||||
} catch (err) {
|
||||
completeActivity(false, err.message || 'Local Holesail failed')
|
||||
presentError(err, 'holesailLocal', { showAlert })
|
||||
const msg = err?.message || String(err)
|
||||
// Designed modal with copy action (never rely on native confirm / alert alone)
|
||||
try {
|
||||
const copy = await confirmDialog({
|
||||
title: 'Could not start local Holesail proxy',
|
||||
body:
|
||||
`${msg}\n\n` +
|
||||
`You can still connect outside peardock:\n` +
|
||||
`npx holesail '${url}'\n\n` +
|
||||
`Then open http://127.0.0.1:<port> in your browser.`,
|
||||
confirmLabel: 'Copy hs:// URL',
|
||||
cancelLabel: 'Dismiss',
|
||||
info: true,
|
||||
icon: 'fa-plug-circle-xmark',
|
||||
})
|
||||
if (copy && navigator.clipboard?.writeText) {
|
||||
await navigator.clipboard.writeText(url)
|
||||
showAlert('success', 'Holesail URL copied')
|
||||
}
|
||||
} catch {
|
||||
presentError(err, 'holesailLocal', { showAlert })
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,6 +201,8 @@
|
||||
margin: 0 0 1.15rem;
|
||||
font-size: 0.92rem;
|
||||
line-height: 1.55;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
.pd-modal-confirm-field {
|
||||
margin: 0 0 1rem;
|
||||
|
||||
Reference in New Issue
Block a user