# FileSelector not working inside Template

**URL:** <https://discourse.holoviz.org/t/fileselector-not-working-inside-template/8967>\
**Category:** Panel\
**Tags:** panel\
**Created:** [October 9, 2025, 4:11am UTC](https://discourse.holoviz.org/t/fileselector-not-working-inside-template/8967 "2025-10-09T04:11:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![StuckDuckF](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/stuckduckf/32/4347_2.png) [@StuckDuckF](https://discourse.holoviz.org/u/StuckDuckF)\
**Post date:** [October 9, 2025, 4:11am UTC](https://discourse.holoviz.org/t/fileselector-not-working-inside-template/8967/1 "2025-10-09T04:11:57Z")

</div>

I can not seem to make File Selector work as part of a template.

```python
import panel as pn # 1.8.2

pn.extension()

class FileSelectorDebug(pn.viewable.Viewer):
    def __init__ (self, **params):
        super(). __init__ (**params)
        self.file_selector = pn.widgets.FileSelector(
            name="Select files",
            directory="~",
        )
    
    def __panel__ (self):
        # This works
        return self.file_selector

        # This results in a frozen Widget (can not interact with it)
        # return pn.template.MaterialTemplate(
        # header_background="#FFA500",
        # logo="https://www.canada.ca/etc/designs/canada/wet-boew/assets/sig-blk-en.svg",
        # site="File Selector Debug",
        # title="File Selector Debug",
        # sidebar=[self.file_selector],
        # )

FileSelectorDebug().servable()

```

---

<div class="post-metadata">

**Author:** ![StuckDuckF](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/stuckduckf/32/4347_2.png) [@StuckDuckF](https://discourse.holoviz.org/u/StuckDuckF)\
**Post date:** [October 9, 2025, 1:38pm UTC](https://discourse.holoviz.org/t/fileselector-not-working-inside-template/8967/2 "2025-10-09T13:38:09Z")

</div>

This also applies to `TextInput` seemingly, but not if I deploy the app.

---

<div class="post-metadata">

**Author:** ![Olivier1](https://discourse.holoviz.org/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@Olivier1](https://discourse.holoviz.org/u/Olivier1)\
**Post date:** [October 11, 2025, 4:22pm UTC](https://discourse.holoviz.org/t/fileselector-not-working-inside-template/8967/3 "2025-10-11T16:22:30Z")

</div>

When I run your code with `panel serve .\test.py --show ` it is working properly. The only issue I get is since the FileSelector is within the sidebar, I do not see everything but when I add in the constructor

```auto
self.file_selector.param.watch(print, "value")

```

I get the event printed in the console. And when I move the FileSelector to the main part of the template, I have the component displayed properly and working as expected.

Do you have any warning or error on your console in your web browser ?

---

<div class="post-metadata">

**Author:** ![StuckDuckF](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/stuckduckf/32/4347_2.png) [@StuckDuckF](https://discourse.holoviz.org/u/StuckDuckF)\
**Post date:** [October 22, 2025, 11:54am UTC](https://discourse.holoviz.org/t/fileselector-not-working-inside-template/8967/4 "2025-10-22T11:54:53Z")

</div>

Turns out this was a Jupyter Base env version conflict with Jupyter Kernel version issue.
