paperclipai/paperclip · warning
[adapter-ui-loader] Failed to load UI parser for "${adapterT
Error message
[adapter-ui-loader] Failed to load UI parser for "${adapterType}": What it means
A browser console warning from the board UI's dynamic adapter parser loader. The UI fetched /api/adapters/:type/ui-parser.js successfully (a 404 would take a different silent path), but initializing the sandboxed Web Worker failed: the worker reported an error evaluating the parser source (syntax error, throw at top level), raised an onerror, or did not signal readiness within the 5-second init timeout. The loader then adds the adapter type to failedLoads, so it will not retry until invalidateDynamicParser is called, and transcripts for that adapter render raw lines instead of parsed entries.
Source
Thrown at ui/src/adapters/dynamic-loader.ts:250
const response = await fetch(`/api/adapters/${encodeURIComponent(adapterType)}/ui-parser.js`);
if (!response.ok) {
failedLoads.add(adapterType);
return null;
}
const source = await response.text();
// Initialise the sandboxed worker with the parser source.
const sandbox = await initSandboxedWorker(source);
sandboxedParsers.set(adapterType, sandbox);
const parserModule = buildParserModule(sandbox);
dynamicParserCache.set(adapterType, parserModule);
console.info(`[adapter-ui-loader] Loaded sandboxed UI parser for "${adapterType}"`);
return parserModule;
} catch (err) {
console.warn(`[adapter-ui-loader] Failed to load UI parser for "${adapterType}":`, err);
failedLoads.add(adapterType);
return null;
} finally {
loadPromises.delete(adapterType);
}
})();
loadPromises.set(adapterType, loadPromise);
return loadPromise;
}
/**
* Invalidate a cached dynamic parser, removing it from both the parser cache
* and the failed-loads set so that the next load attempt will try again.
* Also terminates the sandboxed worker if one exists.
*/
export function invalidateDynamicParser(adapterType: string): boolean {
const wasCached = dynamicParserCache.has(adapterType);View on GitHub (pinned to 120ae5428f)
Solutions
- Open the warned Error object in the console — 'Worker error: <message>' names the parser's syntax/runtime failure; 'Parser worker init timed out' indicates the 5s budget
- Re-validate the adapter's ui-parser.js artifact (syntax-check it with node --check) and re-upload the plugin
- Call invalidateDynamicParser(adapterType) or reload the board to clear the failedLoads cache and retry
- Ensure CSP allows worker scripts (worker-src blob: or the applicable source) if workers never start
Example fix
// before: one failed init permanently disables parsing for the session
const parser = await loadDynamicParser(adapterType);
// after: retry once after cache invalidation, then fall back to raw lines
let parser = await loadDynamicParser(adapterType);
if (!parser) {
invalidateDynamicParser(adapterType); // clears failedLoads + terminates stale worker
parser = await loadDynamicParser(adapterType);
}
registerParser(adapterType, parser ?? { parseStdoutLine: () => [] }); // raw-line fallback Defensive patterns
Strategy: fallback
Validate before calling
async function tryLoadParser(adapterType: string) {
let parser = await loadDynamicParser(adapterType);
if (!parser) {
invalidateDynamicParser(adapterType); // clear failedLoads so one retry is possible
parser = await loadDynamicParser(adapterType);
}
// Explicit raw-line fallback keeps transcripts usable either way
return parser ?? { parseStdoutLine: () => [] };
} Try / catch
try {
parser = await loadDynamicParser(adapterType);
} catch {
console.warn(`Dynamic parser load threw for ${adapterType}; falling back to raw lines`);
parser = null;
}
renderTranscript(parser ?? { parseStdoutLine: () => [] }); Prevention
- Syntax-check adapter parser bundles (node --check) before publishing plugins
- Keep CSP permissive for worker scripts (worker-src) so sandboxed parsers can start
- Remember failedLoads caches failures for the session — call invalidateDynamicParser or reload to retry after fixing the artifact
- Design transcript rendering to degrade to raw lines whenever the parser module is null
When it happens
Trigger: An external adapter's ui-parser.js contains a syntax error or throws during evaluation; the browser blocks/terminates worker scripts (strict CSP without worker-src, security extensions); a slow device or heavy main thread pushes worker init past the 5000 ms timeout; a partially uploaded/corrupted parser artifact on the server.
Common situations: Publishing a plugin with an untranspiled or hand-edited parser bundle; Content-Security-Policy changes that forgot worker-src;开发和生产环境差异 where the artifact was built with newer syntax than the user's browser supports.
Related errors
- Failed to seed CEO instructions:
- [paperclip] sandbox callback bridge kept queued request ${re
- [paperclip] sandbox callback bridge failed to abort queued r
- Failed to stop Daytona sandbox during lease release: ${forma
- [paperclip] UI dist not found; running in API-only mode
AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18).
Data as JSON: /api/errors/144cd1baf76d562a.
Report an issue: GitHub.