Skip to content
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

ApplyTemplateRendererError: Error applying template "toc.html" generated from "toc.yml" #9515

Closed
bbsparkrock opened this issue Dec 7, 2023 · 5 comments
Labels
bug A bug to fix

Comments

@bbsparkrock
Copy link

bbsparkrock commented Dec 7, 2023

Describe the bug
When I run docfx docfx.json --serve, I receive the following error:

Error applying template "toc.html" generated from "toc.yml". You have reached the maximum recursion limit of 256.

To Reproduce
Steps to reproduce the behavior:

  1. Run docfx docfx.json --serve

Expected behavior
No error to appear and my site to be available via localhost.

Context (please complete the following information):

  • OS: Windows
  • Docfx version: 2.74.1

Additional info:
toc.yml example:

I don't receive this error in version 2.73

@bbsparkrock bbsparkrock added the bug A bug to fix label Dec 7, 2023
@KolRah
Copy link

KolRah commented Dec 8, 2023

Hi same for me with non "modern" templates
version 2.74.1 as well

if I use the default template it's fine
if I use any of the external templates in templates/xxx directory I get this

xxx\api\toc.yml: error ApplyTemplateRendererError: Error applying template "toc.html" to view model "xxx\AppData\Local\Temp\2\docfx\viewmodel\api\toc.html.raw.json" generated from "api/toc.yml". You have reached the maximum recursion limit of 256.
at object Render(BlockToken block, Context context)
at void Write(StringRender renderer, SectionToken obj, Context context)
at void Write(RendererBase renderer, MustacheToken obj, TContext context)
at void Write(T obj, TContext context)
at object Render(BlockToken block, Context context)
at void Write(StringRender renderer, PartialToken obj, Context context)
at void Write(RendererBase renderer, MustacheToken obj, TContext context)
at void Write(T obj, TContext context)
at object Render(BlockToken block, Context context)
at void Write(StringRender renderer, InvertedSectionToken obj, Context context)

Thanks

@filzrev
Copy link
Contributor

filzrev commented Dec 12, 2023

if I use the default template it's fine
if I use any of the external templates in templates/xxx directory I get this
xxx\api\toc.yml: error ApplyTemplateRendererError: Error applying template "toc.html" to view model
"xxx\AppData\Local\Temp\2\docfx\viewmodel\api\toc.html.raw.json" generated from "api/toc.yml". You have reached the maximum recursion limit of 256.

It might be related to #9483 changes.

If external docfx template contains toc.html.tmpl file.
It need to rename to toc.html.primary.tmpl.

@KolRah
Copy link

KolRah commented Dec 12, 2023

Wow wonderful it works
Thanks for your kind help, I had not found the related change
Regards

@yufeih
Copy link
Contributor

yufeih commented Dec 13, 2023

Thank you @filzrev ! I updated the release note to include this info.

@yufeih yufeih closed this as completed Dec 13, 2023
@rst4
Copy link

rst4 commented Jan 9, 2024

Actually I experience the same error. I've provided more details in another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix
Projects
None yet
Development

No branches or pull requests

5 participants