-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
ConfigurationError: Config file '{paths_to_try[0]}' does not exist when using serve -f - #4053
Copy link
Copy link
Open
ProperDocs/properdocs
#56Description
Problem
Mkdocs serve does not support using file from stdin, unlike mentioned in the documentation. Using serve -f - leads to ConfigurationError: Config file '{paths_to_try[0]}' does not exist when file changes have been detected.
Reproduction
- Create a
mkdocs.yml - Pass the
mkdocs.ymlto theservecommand:cat mkdocs.yml | mkdocs serve -f - - Make changes to the markdown file
ConfigurationError:Config file '{paths_to_try[0]}' does not exist
INFO - Building documentation...
INFO - Cleaning site directory
INFO - Documentation built in 0.63 seconds
INFO - [17:17:31] Watching paths for changes: 'docs/version/v1'
INFO - [17:17:31] Serving on http://0.0.0.0:8000/
INFO - [17:17:36] Detected file changes
INFO - Building documentation...
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/mkdocs/livereload/__init__.py", line 211, in _build_loop
self.builder()
File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 64, in builder
config = get_config()
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 43, in get_config
config = load_config(
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mkdocs/config/base.py", line 360, in load_config
with _open_config_file(config_file) as fd:
File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mkdocs/config/base.py", line 324, in _open_config_file
raise exceptions.ConfigurationError(f"Config file '{paths_to_try[0]}' does not exist.")
mkdocs.exceptions.ConfigurationError: Config file '<stdin>' does not exist.
ERROR - [17:17:36] An error happened during the rebuild. The server will appear stuck until build errors are resolved.
Originally posted in squidfunk/mkdocs-material#8501
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels