Cannot see my bokeh app embedded in a panel app

I am running a flask app and I have embedded a bokeh/panel app inside it. I can see the panel/bokeh app working fine on localhost. But I cannot see the app on the website (referred to as mysite.com here). There are no errors on the bokehserver or the gunicorn log files. I can see the flask template headers but the app just does not show up.

I have used this same setup in the past and it worked fine. I am having this trouble after updating my environment to:
Python-3.12
Bokeh-3.6.1
Panel-1.5.3
Flask-2.2.3

Here is my flask view entry for the embedded app:

@register_breadcrumb(app, '.tools.myapp', Special app')

def isotensoid():
    script = server_document(url="http://www.mysite.us/apps/myapp")
    return render_template("myapp.html", script=script, template="Flask")

I am also using nginx with reverse proxy configured as:

##
upstream gunicorn {
    server 127.0.0.1:8000;
}

upstream myapps {
    least_conn;                 # Use Least Connections strategy
    server 127.0.0.1:5100;      # The Bokeh server
}

server {
    listen 80;
    server_name mysite.us www.mysite.com;

    # Main Flask application
    location / {
        proxy_pass         http://gunicorn;
        proxy_redirect     off;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
    }

    # Bokeh server at /apps/*
    location /apps/ {
        proxy_pass http://myapps;
        #proxy_pass http://127.0.0.1:5100/apps/; # Use trailing slash for consistency with prefix
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # WebSocket headers
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
    }

    # Static files for Flask
    location /static/ {
        alias /home/ubuntu/flask/mysite/app/static/;
        autoindex on;

    # Prevent unnecessary redirects
    proxy_redirect off;
    }

    # Common files (if applicable)
    location /common/ {
        alias /home/ubuntu/users/common/;
    }

    # Custom error pages
    error_page 500 501 502 503 504 401 402 403 /500.html;
    location = /500.html {
        root /var/www/html;
    }
}

The bokeh server is run via gunicorn:

user=ubuntu
directory=/home/ubuntu/bokeh
environment=BOKEH_RESOURCES='inline'
command = /home/ubuntu/miniforge3/envs/myenv/bin/panel serve myapp --address=127.0.0.1 --port 5100 --allow-websocket-origin=www.mysite.com --allow-websocket-origin=mysite.com --allow-websocket-origin=127.0.0.1:5100 --allow-websocket-origin=x.x.x.x:5100 --prefix /apps --disable-index --disable-index-redirect --use-xheaders --log-level=debug
environment=PATH="/home/ubuntu/miniforge3/envs/myenv/bin:/usr/local/bin:/usr/bin:/bin", PYTHONPATH="/home/ubuntu/miniforge3/envs/myenv/lib/python3.12/site-packages"
autostart=true
autorestart=true
stderr_logfile=/var/log/bokehserver.err.log
stdout_logfile=/var/log/bokehserver.out.log

js error shows:

[bokeh] Failed to repull session Error: could not resolve type 'ImportedStyleSheet', which could be due to a widget or a custom model not being registered before first usage

How can I resolve this?

I am making notes as I progress through the debugging process. I changed my supervisor configuration that calls panel/bokeh app to use ‘bokeh serve’ instead of ‘panel serve’:

user=ubuntu
directory=/home/ubuntu/bokeh
command = /home/ubuntu/miniforge3/envs/myenv/bin/bokeh serve myapp --address=127.0.0.1 --port 5100 --allow-websocket-origin=www.mysite.us --allow-websocket-origin=mysite.us --allow-websocket-origin=127.0.0.1:5100 --allow-websocket-origin=50.112.86.211:5100 --prefix /apps --disable-index --disable-index-redirect --use-xheaders --log-level=debug
environment=PATH="/home/ubuntu/miniforge3/envs/myenv/bin:/usr/local/bin:/usr/bin:/bin", PYTHONPATH="/home/ubuntu/miniforge3/envs/myenv/lib/python3.12/site-packages"
autostart=true
autorestart=true
stderr_logfile=/var/log/bokehserver.err.log
stdout_logfile=/var/log/bokehserver.out.log

I still don’t see the panel app on my site. And I get this js error:

http://mysite.us/tools/static/extensions/panel/bundled/reactiveesm/es-module-shims@%5E1.10.0/dist/es-module-shims.min.js net::ERR_ABORTED 404 (NOT FOUND)

It seems panel is trying to load the js file from a subdirectory of the /tools folder. Unfortunately /tools folder does not physically exist and is only being defined by flask view page to where the apps are being served.

@app.route('/tools/myapp')
@register_breadcrumb(app, '.tools.myapp', 'Special app')

def myapp():
    script = server_document(url="http://www.mysite.us/apps/myapp")
    return render_template("myapp.html", script=script, template="Flask")

I would appreciate any help or support on this. Thanks beforehand.