8000 Mermaid Diagram Offline/Privacy Path Error · Issue #3742 · squidfunk/mkdocs-material · GitHub
[go: up one dir, main page]

Skip to content

Mermaid Diagram Offline/Privacy Path Error #3742

@Vasperous

Description

@Vasperous

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

There appears to be an issue with the Mermaid resources used with the Offline and Privacy plugins. This causes the mermaid diagrams to not be rendered when running the mkdocs build command.

Here is the error from the console.

Failed to load resource: net::ERR_FILE_NOT_FOUND
2bundle.10bf1588.min.js:3 Uncaught ReferenceError: Invalid script: assets/externals/unpkg.com/mermaid@8.13.3/dist/mermaid.min.js
    at bundle.10bf1588.min.js:3:45290
    at e.n [as _subscribe] (bundle.10bf1588.min.js:3:19866)
    at e._trySubscribe (bundle.10bf1588.min.js:3:5506)
    at bundle.10bf1588.min.js:3:5429
    at ot (bundle.10bf1588.min.js:3:2783)
    at e.subscribe (bundle.10bf1588.min.js:3:5343)
    at bundle.10bf1588.min.js:3:30772
    at t.s._next (bundle.10bf1588.min.js:3:6820)
    at t.next (bundle.10bf1588.min.js:3:3140)
    at HTMLScriptElement.s (bundle.10bf1588.min.js:3:22621)

Expected behaviour

Mermaid diagrams should render as expected.

Actual behaviour

Mermaid diagrams are not correctly rendered and just display the actual diagram text.

Steps to reproduce

  1. Create an application with multiple layers/levels of pages
  2. Create a mermaid diagram in each page
  3. Run mkdocs -build

Package versions

  • Python: Python 3.10.0
  • MkDocs: mkdocs, version 1.2.3
  • Material: Version: 8.2.5+insiders.4.11.0

Configuration

site_name: 'My Test Project'
site_description: 'Test Project Description'
site_author: 'Tester'
site_url: ''

# Copyright
copyright: 'Copyright © 2022 Tester'

# If serving from a website you would want 'true', for offline you want false
use_directory_urls: false

nav:
  - Home:
    - Introduction: index.md
    - Layer 1: layer1/test1.md
    - Layer 2: layer1/layer2/test2.md
    - Layer 3: layer1/layer2/layer3/test3.md
    - Layer 4: layer1/layer2/layer3/layer4/test4.md
    - Layer 5: layer1/layer2/layer3/layer4/layer5/test5.md
    - Layer 6: layer1/layer2/layer3/layer4/layer5/layer6/test6.md

theme:
  name: 'material'
  font:
    text: 'Roboto'
    code: 'Roboto Mono'
  icon:
    admonition:
      note: octicons/tag-16
      abstract: octicons/checklist-16
      info: octicons/info-16
      tip: octicons/squirrel-16
      success: octicons/check-16
      question: octicons/question-16
      warning: octicons/alert-16
      failure: octicons/x-circle-16
      danger: octicons/zap-16
      bug: octicons/bug-16
      example: octicons/beaker-16
      quote: octicons/quote-16
  features:
    - content.tabs.link
    - navigation.indexes
    - navigation.tabs
    - navigation.tabs.sticky
    - navigation.top
    - navigation.tracking
    - search.highlight
    - search.share
    - search.suggest
    - toc.autohide

extra:
  generator: false

markdown_extensions:
  - abbr
  - admonition
  - attr_list
  - def_list
  - footnotes
  - meta
  - pymdownx.details
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg
  - pymdownx.highlight:
      use_pygments: true
  - pymdownx.inlinehilite
  - pymdownx.keys
  - pymdownx.snippets:
      base_path: ext_md
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  - pymdownx.tabbed:
      alternate_style: true
  - pymdownx.tasklist:
      custom_checkbox: true
  - toc:
      permalink: '#'
      toc_depth: 5

plugins:
  - search
  - git-revision-date-localized:
      fallback_to_build_date: true
  - tags:
      tags_file: tags.md
  - offline
  - privacy

System information

  • Operating system: Mac OS
  • Browser: Brave & Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0