diff --git a/vizro-core/src/vizro/_vizro.py b/vizro-core/src/vizro/_vizro.py index 23a30520d..f5f6886c2 100644 --- a/vizro-core/src/vizro/_vizro.py +++ b/vizro-core/src/vizro/_vizro.py @@ -224,6 +224,5 @@ def _make_resource_spec(path: Path) -> _ResourceSpec: # irrelevant here. The way the file is requested is through a relative url("./fonts/...") in the requesting # CSS file. When the CSS file is served from the CDN then this will refer to the font file also on the CDN. resource_spec["dynamic"] = True - print(resource_spec) return resource_spec diff --git a/vizro-core/src/vizro/models/_dashboard.py b/vizro-core/src/vizro/models/_dashboard.py index 6ab4559b1..b4311895f 100644 --- a/vizro-core/src/vizro/models/_dashboard.py +++ b/vizro-core/src/vizro/models/_dashboard.py @@ -3,7 +3,7 @@ import base64 import logging from functools import partial -from pathlib import Path +from pathlib import Path, PureWindowsPath from typing import TYPE_CHECKING, Literal, TypedDict import dash @@ -335,4 +335,5 @@ def _infer_image(filename: str): if assets_folder.is_dir(): for path in Path(assets_folder).rglob(f"{filename}.*"): if path.suffix in valid_extensions: - return str(path.relative_to(assets_folder)) + # Return path as posix so image source comes out correctly on Windows. + return path.relative_to(assets_folder).as_posix()