Skip to content

Chat interface not apperaing at all #110

Description

@CDLProduction

Describe the bug
Fresh install from source code and build with commands from READ.me, problem persist on dev server and on nginx server, all configured created directories, copy files, when access test page blank page after providing name and email, appear purple button but when click error given.

To Reproduce
Steps to reproduce the behavior:

  1. Fresh build from latest sources and valid config file
  2. Copy target to /var/www/chatterbox/ or any other
  3. Create nginx page with proxy forward to matrix server
  4. Create an test implementation page
  5. Access page, provide name and email and go to chat,

Expected behavior
Chat interface should load, room in matrix created and invite coming.

Screenshots
Test page:
Image

Image Image Image Image

Desktop (please complete the following information):

  • OS: debian 12 server and windows 10
  • Browser chrome, zen browser
  • Version latest versions of browsers and os

Additional context
Script that are called for start chat

<script>
    document.getElementById('chat-button').onclick = () => {
      document.getElementById('chat-popup').style.display = 'block';
    };

    function startChat() {
      const name = document.getElementById('user-name').value;
      const email = document.getElementById('user-email').value;
      if (name && email) {
        document.getElementById('chat-form').style.display = 'none';
        document.getElementById('chat-widget').style.display = 'block';

        // Load Chatterbox script dynamically
        const script = document.createElement('script');
        script.src = "http://172.20.89.50:8081/assets/parent.js";  // Your Chatterbox assets URL
        script.type = "module";
        script.id = "chatterbox-script";
        document.getElementById('chat-widget').appendChild(script);

        // Set config location if needed
        window.CHATTERBOX_CONFIG_LOCATION = "http://172.20.89.50:8081/config.json";
      } else {
        alert('Please enter your details.');
      }
    }
  </script>

nginx config for chatterbox

server {
    listen 8081;
    server_name 172.20.89.50;
    root /var/www/chatterbox;
    index chatterbox.html;

    location / {
        try_files $uri $uri/ =404;
        add_header 'Access-Control-Allow-Origin' '*' always;  # Allow all for testing (replace * with http://172.20.89.50:8082 for production)
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
    }

    location /assets/ {
        alias /var/www/chatterbox/assets/;
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
    }

    location /config.json {
        alias /var/www/chatterbox/config.json;
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
    }

    location /favicon.ico {
        alias /var/www/chatterbox/favicon.ico;
        access_log off;
        log_not_found off;
    }

    # Proxy .well-known for Matrix client discovery
    location ~ ^/.well-known/matrix/ {
        proxy_pass http://172.20.89.50:8008;
        proxy_set_header Host $host;
    }
}

and for test site 

server {
listen 8082;
server_name 172.20.89.50;

root /var/www/test-site;
index index.html;

location / {
    try_files $uri $uri/ =404;
}

}

SyntaxError: JSON.parse: expected property name or '}' at line 2 column 1 of the JSON data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions