# How do I display my html page in the preview panel? ✅ SOLVED

**URL:** <https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564>\
**Category:** Previews\
**Created:** [August 21, 2024, 8:37pm UTC](https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564 "2024-08-21T20:37:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fred3.0](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/fred3.0/32/1241_2.png) [@Fred3.0](https://community.firebasestudio.dev/u/Fred3.0)\
**Post date:** [August 21, 2024, 8:37pm UTC](https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564/1 "2024-08-21T20:37:00Z")

</div>

Hi there,  
Question says it all, I can’t figure out a way to display my html page (named form.html) in the IDX preview panel on the right.  
Any idea, please? Thanks

---

<div class="post-metadata">

**Author:** ![Ankit](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/ankit/32/1389_2.png) [@Ankit](https://community.firebasestudio.dev/u/Ankit)\
**Post date:** [August 21, 2024, 9:26pm UTC](https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564/2 "2024-08-21T21:26:25Z")

</div>

You can install “live server” extension and start a preview server for the html page!

---

<div class="post-metadata">

**Author:** ![Fred3.0](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/fred3.0/32/1241_2.png) [@Fred3.0](https://community.firebasestudio.dev/u/Fred3.0)\
**Post date:** [August 21, 2024, 10:01pm UTC](https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564/3 "2024-08-21T22:01:09Z")

</div>

Thanks! I thought it would open in the IDX preview panel but it opens a new browser tab, just like by running a localhost:3000  
Better than nothing.

---

<div class="post-metadata">

**Author:** ![Srivats\_Venkataraman](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/srivats_venkataraman/32/318_2.png) [@Srivats\_Venkataraman](https://community.firebasestudio.dev/u/Srivats_Venkataraman)\
**Post date:** [August 22, 2024, 1:56am UTC](https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564/4 "2024-08-22T01:56:44Z")

</div>

You would need to define which page you want executed via the dev.nix file in the preview section… not quite sure how to do it for vanilla html pages though

---

<div class="post-metadata">

**Author:** ![Fred3.0](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/fred3.0/32/1241_2.png) [@Fred3.0](https://community.firebasestudio.dev/u/Fred3.0)\
**Post date:** [August 22, 2024, 10:10am UTC](https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564/5 "2024-08-22T10:10:48Z")

</div>

From the documentation I’ve done this:

```js
idx = {
    # enable previews
    previews = {
      enable = true;
      previews = {
        web = {
          command = [
            "python3"
            "src/form.html"
# "--"
# "--port"
# "$PORT"
# "--host"
# "0.0.0.0"
# "--disable-host-check"
          ];
          manager = "web";
        };
      };
    };

```

But I get:

```auto
Error: <!DOCTYPE html>
Error: ^
Error: SyntaxError: invalid syntax

```

The Python interpreter tried to execute my form.html file as if it was a py script, giving me SyntaxError. The HTML file is executed directly by python which is wrong, no clue how to fix this.

---

<div class="post-metadata">

**Author:** ![kirupa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/kirupa/32/4_2.png) [@kirupa](https://community.firebasestudio.dev/u/kirupa)\
**Post date:** [August 22, 2024, 3:57pm UTC](https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564/6 "2024-08-22T15:57:21Z")

</div>

@Fred3.0 - you can use the dev.nix contents from the plain HTML project instead:

```auto
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
  # Which nixpkgs channel to use.
  channel = "stable-23.11"; # or "unstable"
  # Use https://search.nixos.org/packages to find packages
  packages = [
    pkgs.nodejs_20
    pkgs.python3
  ];
  # Sets environment variables in the workspace
  env = {};
  idx = {
    # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
    extensions = [
      # "vscodevim.vim"
    ];
    # Enable previews and customize configuration
    previews = {
      enable = true;
      previews = {
        web = {
          command = ["python3" "-m" "http.server" "$PORT" "--bind" "0.0.0.0"];
          manager = "web";
        };
      };
    };
  };
}

```

That should avoid this error.

---

<div class="post-metadata">

**Author:** ![Fred3.0](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/fred3.0/32/1241_2.png) [@Fred3.0](https://community.firebasestudio.dev/u/Fred3.0)\
**Post date:** [August 22, 2024, 6:25pm UTC](https://community.firebasestudio.dev/t/how-do-i-display-my-html-page-in-the-preview-panel-solved/1564/7 "2024-08-22T18:25:21Z")

</div>

Superbe!  
I could not get that nix file from the template since I’ve progressed too much on my current project with a python-flask / poetry setup. But I’ve just copied the below lines that interested me and voila.

```js
previews = {
      enable = true;
      previews = {
        web = {
          command = ["python3" "-m" "http.server" "$PORT" "--bind" "0.0.0.0"];
          manager = "web";
        };
      };
    };
```
