diff --git a/panel/template/base.py b/panel/template/base.py index c94e8d3c19..3f33dd17cc 100644 --- a/panel/template/base.py +++ b/panel/template/base.py @@ -448,8 +448,9 @@ def _init_doc(self, doc=None, comm=None, title=None, notebook=False, location=Tr def _template_resources(self): name = type(self).__name__.lower() resources = _settings.resources(default="server") + base_url = state.base_url[1:] if state.base_url.startswith('/') else state.base_url if resources == 'server': - dist_path = urljoin(state.base_url, LOCAL_DIST) + dist_path = urljoin(base_url, LOCAL_DIST) else: dist_path = CDN_DIST diff --git a/panel/util.py b/panel/util.py index a4a27c9327..bc32961bdf 100644 --- a/panel/util.py +++ b/panel/util.py @@ -342,7 +342,7 @@ def bundled_files(model, file_type='javascript'): filepath = url_path(url) test_filepath = filepath.split('?')[0] if resources == 'server' and os.path.isfile(os.path.join(bdir, test_filepath)): - files.append(f'/static/extensions/panel/bundled/{name}/{filepath}') + files.append(f'static/extensions/panel/bundled/{name}/{filepath}') else: files.append(url) return files