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

Docfx not working on apple silicon #9081

Closed
bartofzo opened this issue Aug 14, 2023 · 3 comments
Closed

Docfx not working on apple silicon #9081

bartofzo opened this issue Aug 14, 2023 · 3 comments
Labels
bug A bug to fix

Comments

@bartofzo
Copy link

Running docfc gives the message:

There is no template processing document type(s): Conceptual,ManagedReference,Toc

If I run the command docfx template list, it gives me nothing.
Also when I run docfx template export default, it says:
default is not an embedded template.

My build succeeds but the website is not served. The _site folder only contains images, manifest.json and xrefmap.yml.

Expected behavior
The site should build

Context (please complete the following information):

  • OS: MacOS 13.2.1, Apple M2 Pro
  • Docfx version: 2.70.0

Additional context
The problems began when switching to a macbook pro M2. First I had this problem but patched it:
#9047

Before on an intel mac everthing worked fine with the same project.

@bartofzo bartofzo added the bug A bug to fix label Aug 14, 2023
@bartofzo
Copy link
Author

Some additional info.

When I type:
docfx template list,

I get the following error:
Error: Could not find a part of the path '/opt/homebrew/Cellar/docfx/2.70.0/libexec/templates'.

I've reinstalled docfx and now when building I get message for every API source file saying:
xxxxxx.yml: No template bundle found for ManagedReference, model will be ignored.

Same goes for resources:
No template bundle found for Resource, model will be ignored

I've also tried just pasting the templates directory from the docfx source in my project and adjusting docfx.json to use a template from there. I'm using default + statictoc.

I then get these warnings:
xxxx/docfx_project/ManagedReference.html.primary.js: warning: Not a valid template preprocessor, ignored: Cannot read property 'path' of null
xxxx/RestApi.html.primary.js: warning: Not a valid template preprocessor, ignored: Cannot read property 'path' of null
xxxx/UniversalReference.html.primary.js: warning: Not a valid template preprocessor, ignored: Cannot read property 'path' of null
xxxx/conceptual.html.primary.js: warning: Not a valid template preprocessor, ignored: Cannot read property 'path' of null

And the output of the site is jibberish. All of the API documents are empty. The articles contain the text I wrote but no other layout.

Also, I'm having the same issue as:
#9047
So it's worth mentioning that I first need to change the $PATH and copy libhostfxr.dylib as described here:
microsoft/vscode-dotnettools#120 (comment)

All of these things may be related. Hoping somebody can be of help here! I need to update documentation for an existing project and I'm completely stuck.

Also wondering if there is anybody on Apple Silicon for who docfx works as expected?

@bartofzo bartofzo changed the title There is no template processing document type(s): Conceptual,ManagedReference,Toc Docfx not working on apple silicon Aug 17, 2023
@filzrev
Copy link
Contributor

filzrev commented Aug 17, 2023

Error: Could not find a part of the path '/opt/homebrew/Cellar/docfx/2.70.0/libexec/templates'.

It seems you are using docfx that installed with homebrew.

docfx formula
https://formulae.brew.sh/formula/docfx

installation scripts(docfx.rb)
https://github.com/Homebrew/homebrew-core/blob/bf6baa7f9fcf26f5e132133d430840fcbbfa0ee6/Formula/d/docfx.rb

This homebrew formula seems some step are missing to build templates.
So it fails to load template when running docfx command.

Workaround

I've also tried just pasting the templates directory from the docfx source.

You needs to copy templates that are already build. Check Release Page's zip file.

or simply use .NET global tools version or Self-Contained version that published on GitHub release page
to resolve problems.

@bartofzo
Copy link
Author

After copying the templates from the build into my project, it works. Thank you!

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

2 participants