fix: restore missing sqlite/observations/files.js shipped module#3273
Open
E0993599799 wants to merge 1 commit into
Open
fix: restore missing sqlite/observations/files.js shipped module#3273E0993599799 wants to merge 1 commit into
E0993599799 wants to merge 1 commit into
Conversation
worker-service.cjs dynamically requires ../sqlite/observations/files.js
via createRequire(__IMPORT_META_URL__) (source: src/services/sqlite/
observations/files.ts), but this file was never copied into the shipped
plugin/ output. Every Chroma backfill and live observation sync failed
with:
ResolveMessage: Cannot find module '../sqlite/observations/files.js'
from '.../plugin/scripts/worker-service.cjs'
Added a minimal, dependency-free CommonJS reimplementation of
parseFileList at the exact path worker-service.cjs expects, plus a
nested package.json (type: commonjs) so Node/Bun parse it as CJS
despite the parent plugin/package.json declaring type: module.
Verified locally: restarted the worker and watched Chroma backfill
succeed end-to-end across multiple projects with zero module-resolution
errors (previously every project failed at this step).
Contributor
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.
Summary
worker-service.cjsdynamically requires../sqlite/observations/files.jsviacreateRequire(__IMPORT_META_URL__), sourced fromsrc/services/sqlite/observations/files.ts. This file is intentionally excluded from the main esbuild/bundler output (it's loaded lazily at runtime instead of being statically bundled), but the build does not currently copy/compile it into the shippedplugin/output directory.formatObservationDocs→jce()with:Fix
Adds the missing module at the exact path
worker-service.cjsresolves it to:plugin/sqlite/observations/files.js— minimal, dependency-free CommonJS reimplementation ofparseFileList(the only export this call site needs). Left dependency-free (noutils/logger.jsimport) since that module isn't shipped inplugin/either.plugin/sqlite/package.json—{ "type": "commonjs" }, so Node/Bun parse the.jsfile as CommonJS despite the parentplugin/package.jsondeclaring"type": "module"(Node resolves module type from the nearestpackage.jsonup the directory tree).This is a packaging-only fix at the shipped-output level. The real fix likely belongs in the build pipeline (
src/build) so this file gets compiled/copied automatically on release — flagging that as the more durable long-term fix, but wanted to get a working patch out first.Test plan
Cannot find module '../sqlite/observations/files.js'error in a live worker's logs, across every project during backfill.createRequire(pathToFileURL(worker-service.cjs).href)("../sqlite/observations/files.js")call directly withbun— resolves and returnsparseFileListcorrectly after the fix.Dheva-oracle-deploy,aeimathes-oracle,aris-oracle,captain-maid/*, ...) with zero module-resolution errors, where previously every single project failed at this step.🤖 Generated with Claude Code