-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Bug Report
Description
In TemplateArchiveProcessor.ts, both the trigger() and init() methods
hardcode the logic entry point as logic/logic.ts when looking up compiled code:
code: compiledCode['logic/logic.ts'].code, // TODO DCS - how to find the code to run?This assumes the logic file is always named exactly logic/logic.ts. If a template
uses any other filename, compiledCode['logic/logic.ts'] returns undefined,
causing an unhelpful crash:
TypeError: Cannot read properties of undefined (reading 'code')
Location
- File:
src/TemplateArchiveProcessor.ts - Lines: 120 and 169 (both
trigger()andinit()methods)
Fix
Dynamically find the entry point by searching for a file directly inside the
logic/ folder that is not auto-generated:
const entryPoint = Object.keys(compiledCode).find(
key => key.startsWith('logic/') && !key.includes('generated/')
);
if (!entryPoint) {
throw new Error('Could not find compiled logic entry point');
}
code: compiledCode[entryPoint].code,Additional Notes
The // TODO DCS comment on both lines suggests this was flagged by the
original author as needing a proper fix.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels