mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
fix(producer): resolve manifest from sibling dist/ directory
The build script already copies hyperframe.manifest.json into the producer's dist/ directory, but the runtime loader never checked there. This caused `window.__hf not ready` timeouts when rendering via the published npm package outside the monorepo, since the only candidate paths were monorepo-relative. Add a sibling-directory lookup (same dir as the bundled module) as the first candidate, so the manifest is found whether running from source, a bundled dist/, or an npm install. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const PRODUCER_DIR = dirname(fileURLToPath(import.meta.url));
|
||||
const SIBLING_MANIFEST_PATH = resolve(PRODUCER_DIR, "hyperframe.manifest.json");
|
||||
const MODULE_RELATIVE_MANIFEST_PATH = resolve(
|
||||
PRODUCER_DIR,
|
||||
"../../../core/dist/hyperframe.manifest.json",
|
||||
@@ -32,7 +33,11 @@ export function resolveHyperframeManifestPath(): string {
|
||||
if (process.env.PRODUCER_HYPERFRAME_MANIFEST_PATH) {
|
||||
return process.env.PRODUCER_HYPERFRAME_MANIFEST_PATH;
|
||||
}
|
||||
const candidates = [...CWD_RELATIVE_MANIFEST_PATHS, MODULE_RELATIVE_MANIFEST_PATH];
|
||||
const candidates = [
|
||||
SIBLING_MANIFEST_PATH,
|
||||
...CWD_RELATIVE_MANIFEST_PATHS,
|
||||
MODULE_RELATIVE_MANIFEST_PATH,
|
||||
];
|
||||
for (const candidate of candidates) {
|
||||
if (existsSync(candidate)) {
|
||||
return candidate;
|
||||
|
||||
Reference in New Issue
Block a user