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

Error when trying to do mkdocs serve #90

Open
franciscaGrandon opened this issue Nov 16, 2022 · 0 comments
Open

Error when trying to do mkdocs serve #90

franciscaGrandon opened this issue Nov 16, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@franciscaGrandon
Copy link

Hi everyone!
I'm currently using the latest version released of the plugin (v1.0.4) and my mkdocs.yml file has this line inside the navigation part.

nav:
  - Home: index.md
  - API:
     - books_try1: '!include ./packages/cr_packages/cr-customer-booksuite/mkdocs.yml'
     - books_tr2: '*include ./packages/cr_packages/*/mkdocs.yml'

plugins:
  - monorepo
  - search:
      lang: en
  - mkdocstrings:

The problem is that is not working with any of the !include possibilities, I always get this same error:

INFO     -  Building documentation...
INFO     -  Cleaning site directory
INFO     -  The following pages exist in the docs directory, but are not included in the "nav"
            configuration:
              - keep_data_updated.md
              - workflow_deepdive.md
ERROR    -  Error reading page 'cr-customer-booksuite/index.md': 'NoneType' object has no
            attribute 'endswith'
Traceback (most recent call last):
  File "/opt/anaconda3/envs/c1wv2/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs/__main__.py", line 181, in serve_command
    serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, **kwargs)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 63, in serve
    config = builder()
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 58, in builder
    build(config, live_server=live_server, dirty=dirty)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs/commands/build.py", line 292, in build
    _populate_page(file.page, config, files, dirty)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs/commands/build.py", line 163, in _populate_page
    page = config['plugins'].run_event(
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs/plugins.py", line 102, in run_event
    result = method(item, **kwargs)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs_monorepo_plugin/plugin.py", line 71, in on_pre_page
    set_edit_url(config, page, self)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs_monorepo_plugin/edit_uri.py", line 105, in set_edit_url
    page.edit_url = edit_url.build()
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs_monorepo_plugin/edit_uri.py", line 98, in build
    if self.__has_repo():
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs_monorepo_plugin/edit_uri.py", line 85, in __has_repo
    page_config_file_yaml = self.__get_page_config_file_yaml()
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs_monorepo_plugin/edit_uri.py", line 82, in __get_page_config_file_yaml
    return self.__load_page_config_file(f)
  File "/opt/anaconda3/envs/c1wv2/lib/python3.8/site-packages/mkdocs_monorepo_plugin/edit_uri.py", line 68, in __load_page_config_file
    and not page_repo_url.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

I was reading some ways to address this problem, and found this two issues: #77 and backstage/mkdocs-techdocs-core#62

I think they are related to this error, but other than installing the v1.0.0 version, does anyone know a different way to fix this?

Thanks a lot in advance!

@franciscaGrandon franciscaGrandon changed the title "set_edit_url" error when trying to build the server Error when trying to do mkdocs serve Dec 19, 2022
@bih bih added the bug Something isn't working label Jan 4, 2024
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

2 participants