-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open
Description
Context
We are using mkdocs-insiders with the social plugin. We get an error (which may be related to our docs) but I'm not too sure how to track it down.
Bug description
Our Insiders build fails in Netlify with the following stack trace:
2:02:25 PM: Traceback (most recent call last):
2:02:25 PM: File "/opt/buildhome/python3.8/bin/mkdocs", line 8, in <module>
2:02:25 PM: sys.exit(cli())
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
2:02:25 PM: return self.main(*args, **kwargs)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/click/core.py", line 1055, in main
2:02:25 PM: rv = self.invoke(ctx)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
2:02:25 PM: return _process_result(sub_ctx.command.invoke(sub_ctx))
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
2:02:25 PM: return ctx.invoke(self.callback, **ctx.params)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/click/core.py", line 760, in invoke
2:02:25 PM: return __callback(*args, **kwargs)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/mkdocs/__main__.py", line 250, in build_command
2:02:25 PM: build.build(cfg, dirty=not clean)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/mkdocs/commands/build.py", line 332, in build
2:02:25 PM: config.plugins.run_event('post_build', config=config)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/mkdocs/plugins.py", line 522, in run_event
2:02:25 PM: result = method(**kwargs)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/material/plugins/social/plugin.py", line 173, in on_post_build
2:02:25 PM: promise.result()
2:02:25 PM: File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result
2:02:25 PM: return self.__get_result()
2:02:25 PM: File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
2:02:25 PM: raise self._exception
2:02:25 PM: File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
2:02:25 PM: result = self.fn(*self.args, **self.kwargs)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/material/plugins/social/plugin.py", line 180, in _cache_image
2:02:25 PM: image = render_function()
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/material/plugins/social/plugin.py", line 160, in <lambda>
2:02:25 PM: render_function = lambda: self._render_card(site_name, title, description)
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/material/plugins/social/plugin.py", line 209, in _render_card
2:02:25 PM: self._render_text((826, 328), font, title, 3, 30),
2:02:25 PM: File "/opt/buildhome/python3.8/lib/python3.8/site-packages/material/plugins/social/plugin.py", line 242, in _render_text
2:02:25 PM: text = re.sub(r"(<[^>]+>)", "", text)
2:02:25 PM: File "/usr/lib/python3.8/re.py", line 210, in sub
2:02:25 PM: return _compile(pattern, flags).sub(repl, string, count)
2:02:25 PM: TypeError: expected string or bytes-like object
I get the same error when running locally:
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/bin/mkdocs", line 8, in <module>
sys.exit(cli())
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/site-packages/mkdocs/__main__.py", line 250, in build_command
build.build(cfg, dirty=not clean)
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/site-packages/mkdocs/commands/build.py", line 332, in build
config.plugins.run_event('post_build', config=config)
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/site-packages/mkdocs/plugins.py", line 522, in run_event
result = method(**kwargs)
File "/Users/jawnsy/projects/work/mkdocs-material-insiders/material/plugins/social/plugin.py", line 173, in on_post_build
promise.result()
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/jawnsy/projects/work/mkdocs-material-insiders/material/plugins/social/plugin.py", line 180, in _cache_image
image = render_function()
File "/Users/jawnsy/projects/work/mkdocs-material-insiders/material/plugins/social/plugin.py", line 160, in <lambda>
render_function = lambda: self._render_card(site_name, title, description)
File "/Users/jawnsy/projects/work/mkdocs-material-insiders/material/plugins/social/plugin.py", line 209, in _render_card
self._render_text((826, 328), font, title, 3, 30),
File "/Users/jawnsy/projects/work/mkdocs-material-insiders/material/plugins/social/plugin.py", line 242, in _render_text
text = re.sub(r"(<[^>]+>)", "", text)
File "/opt/homebrew/Caskroom/miniconda/base/envs/prefect2-dev/lib/python3.10/re.py", line 209, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
Related links
- https://squidfunk.github.io/mkdocs-material/insiders/getting-started/#built-in-plugins
- https://github.com/squidfunk/mkdocs-material/tree/master/material/plugins/social
- https://github.com/PrefectHQ/prefect/pull/9294/files
Reproduction
I don't know how to create a minimal reproduction for this particular issue, given the information in the stack trace and build logs
Steps to reproduce
Running an Insiders build from https://github.com/PrefectHQ/prefect with mkdocs.insiders.yml and the social plugin enabled should reproduce this issue.
Browser
No response
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open