Skip to content

fix(go/genkit): Reset knownpartials and helpers array for every new template #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

rutujaD1999
Copy link
Collaborator

@rutujaD1999 rutujaD1999 commented Jun 11, 2025

fix(go/genkit): Reset knownpartials and helpers array for every new template [#312]
ISSUES:
[ ] #3019

CHANGELOG:
[ ] Add initialize method for template, knownpartials and knownhelpers fields in the dotprompt instance. This is done because every time a new prompt is compiled a new template is created using handlebars and then partials and helpers are registered for this template. Earlier only the template was created new but the knownhelpers and knownpartials arrays were not initialized again. This led to using knownhelpers and knownpartials for older template with the current template. And instead of registering the helpers and partials for the new template, error was thrown saying partials and helpers are already registered because they were already present in the knownpartials and knownhelpers arrays.

@github-actions github-actions bot added the go label Jun 11, 2025
@rutujaD1999 rutujaD1999 requested a review from apascal07 June 11, 2025 12:14
@apascal07 apascal07 merged commit bb73406 into main Jun 11, 2025
6 checks passed
@apascal07 apascal07 deleted the drutuja/issue_3019 branch June 11, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants