{"record":{"id":"3e413475726453e4","repo":"streamlit/streamlit","slug":"kind-path-abs-path-is-outside-the-declared-a","errorCode":null,"errorMessage":"{kind} path '{abs_path}' is outside the declared asset_dir '{root}'.","messagePattern":"(.+?) path '(.+?)' is outside the declared asset_dir '(.+?)'\\.","errorType":"validation","errorClass":"StreamlitComponentRegistryError","httpStatus":null,"severity":"error","filePath":"lib/streamlit/components/v2/component_path_utils.py","lineNumber":191,"sourceCode":"            Human-readable descriptor for error messages (e.g., \"js\" or \"css\")\n\n        Raises\n        ------\n        StreamlitComponentRegistryError\n            If the path cannot be resolved or if the resolved path does not\n            reside within ``root`` after following symlinks.\n        \"\"\"\n        try:\n            resolved = abs_path.resolve()\n            root_resolved = root.resolve()\n        except Exception as e:\n            raise StreamlitComponentRegistryError(\n                f\"Failed to resolve {kind} path '{abs_path}': {e}\"\n            ) from e\n\n        # Use Path.is_relative_to to avoid insecure prefix-based checks\n        if not resolved.is_relative_to(root_resolved):\n            raise StreamlitComponentRegistryError(\n                f\"{kind} path '{abs_path}' is outside the declared asset_dir '{root}'.\"\n            )\n\n    @staticmethod\n    def looks_like_inline_content(value: str) -> bool:\n        r\"\"\"Heuristic to detect inline JS/CSS content strings.\n\n        Treat a string as a file path ONLY if it looks path-like:\n        - Does not contain newlines\n        - Contains glob characters (*, ?, [, ])\n        - Starts with ./, /, or \\\n        - Contains a path separator (\"/\" or \"\\\\\")\n        - Or ends with a common asset extension like .js, .mjs, .cjs, or .css\n\n        Otherwise, treat it as inline content.\n\n        Parameters\n        ----------","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/streamlit/streamlit/blob/202661fc552db98c2ba0bb0e113d619689baf9de/lib/streamlit/components/v2/component_path_utils.py#L173-L209","documentation":"Error \"{kind} path '{abs_path}' is outside the declared asset_dir '{root}'.\" thrown in streamlit/streamlit.","triggerScenarios":"Thrown at lib/streamlit/components/v2/component_path_utils.py:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"202661fc552db98c2ba0bb0e113d619689baf9de","analyzedAt":"2026-08-26T09:13:21.291Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}