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

Theme error #2158

Open
RalfKellner opened this issue Jun 4, 2024 · 1 comment
Open

Theme error #2158

RalfKellner opened this issue Jun 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@RalfKellner
Copy link

Describe the bug

context
Until today everything worked fine, since today when I build my book, I receive a shinx related error which you can see below. I tried to clean and build, I also uninstalled and reinstalled the package. The error also occurs if I buld a fresh testbook with "jb create testbook". However, it does not occur if I do this in a different folder on my computer. Has anyone an idea, how this may be handled? The error states:

Theme error:
An error happened in rendering the page intro.
Reason: TemplateNotFound("'static/webpack-macros.html' not found in ['/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme/components', PosixPath('/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme'), '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/themes/basic']")
Traceback (most recent call last):
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/html/init.py", line 1119, in handle_page
output = self.templates.render(templatename, ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/jinja2glue.py", line 200, in render
return self.environment.get_template(template).render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
{%- extends "layout.html" %}
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/layout.html", line 1, in top-level template code
{% extends "pydata_sphinx_theme/layout.html" %}
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme/../pydata_sphinx_theme/layout.html", line 8, in top-level template code
{%- import "static/webpack-macros.html" as _webpack with context %}
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/jinja2glue.py", line 222, in get_source
raise TemplateNotFound(msg)
jinja2.exceptions.TemplateNotFound: 'static/webpack-macros.html' not found in ['/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme/components', PosixPath('/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme'), '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/themes/basic']

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jupyter_book/sphinx.py", line 167, in build_sphinx
app.build(force_all, filenames)
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/application.py", line 351, in build
self.builder.build_update()
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/init.py", line 293, in build_update
self.build(to_build,
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/init.py", line 362, in build
self.write(docnames, list(updated_docnames), method)
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/init.py", line 570, in write
self._write_serial(sorted(docnames))
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/init.py", line 580, in _write_serial
self.write_doc(docname, doctree)
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/html/init.py", line 665, in write_doc
self.handle_page(docname, ctx, event_arg=doctree)
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/builders/html/init.py", line 1126, in handle_page
raise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") %
sphinx.errors.ThemeError: An error happened in rendering the page intro.
Reason: TemplateNotFound("'static/webpack-macros.html' not found in ['/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme/components', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme/components', PosixPath('/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx_book_theme/theme/sphinx_book_theme'), '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/pydata_sphinx_theme/theme/pydata_sphinx_theme', '/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/sphinx/themes/basic']")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/bin/jb", line 10, in
sys.exit(main())
^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jupyter_book/cli/main.py", line 317, in build
builder_specific_actions(
File "/Users/ralf/Library/Mobile Documents/comappleCloudDocs/Kurse/FDAML/.venv/lib/python3.11/site-packages/jupyter_book/cli/main.py", line 528, in builder_specific_actions
raise RuntimeError(_message_box(msg, color="red", doprint=False)) from result

Reproduce the bug

  1. Create a virtual environment: python3 -m venv .venv
  2. Install jupyter-book: pip install jupyter-book
  3. Create book: jb create testbook
  4. Build book: jb build testbook

As stated above, I do not expect that this results in an error for everyone, as it seems to be related to my location and the folder I am currently working.

List your environment

jupyter-book 1.0.0

@RalfKellner RalfKellner added the bug Something isn't working label Jun 4, 2024
Copy link

welcome bot commented Jun 4, 2024

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant