Giter Site home page Giter Site logo

Comments (11)

barisusakli avatar barisusakli commented on May 2, 2024

Hi prabhu, can you post your config.json file? Seems like the base url isn't set properly.

from nodebb.

julianlam avatar julianlam commented on May 2, 2024

Prabhu,

In addition to posting your config.json file, I'd also like to point out that the README.md contains installation instructions that apply to an older version of NodeBB.

After cloning the repository, and running npm install to resolve deps, you should just need to run node app --setup to initiate the setup script.

from nodebb.

prabhu avatar prabhu commented on May 2, 2024

Hi Guys,

Thanks for coming back quickly!

I noticed the bug in your config generation code, where it was generating url with http:// in it, whereas src/app.js was prefixing http:// at line 15. I quietly tried fixing it. Still getting the same error. Here is my modified config.json.

public/config.json

{
    "socket": {
        "address": "localhost",
        "port": 4567
    },
    "api_url": "http://localhost:4567/api/"
}

config.json

{
    "secret": "secret",
    "base_url": "http://localhost",
    "port": 4567,
    "use_port": true,
    "upload_path": "/public/uploads/",
    "redis": {
        "host": "127.0.0.1",
        "port": 6379
    }
}

Not to mention getting the same error, while trying from a fresh checkout from git with no modifications.

Hope it helps.

from nodebb.

psychobunny avatar psychobunny commented on May 2, 2024

Hey Prabhu, welcome to NodeBB :)

Am wondering if you're getting any errors serverside - typically a 500 coming back means something crashed in node.js

If you can provide the node.js stack trace we'll look into it. Thanks!

from nodebb.

julianlam avatar julianlam commented on May 2, 2024

By comparing our config files, it looks to be your public/config.json that is misconfigured (which is odd, as the socket address should match base_url in the server configuration.)

Try restoring the code to the latest version (back up any changes as necessary!) and try prepending http:// to the "socket address" value in public/config.json, or by running node app --setup again.

$ git reset --hard HEAD
$ git pull
$ node app --setup

from nodebb.

prabhu avatar prabhu commented on May 2, 2024

I had manually changed the url, since src/app.js was also prefixing http:// resulting in an invalid url.

// Problematic line 15
socket = io.connect('http://' + config.socket.address + config.socket.port? ':' + config.socket.port : '');

I have reset everything like you suggested, still no luck. There is nothing in the console even though there is 500 being returned. Let me try to produce a stack trace somehow.

from nodebb.

julianlam avatar julianlam commented on May 2, 2024

Hi Prabhu,

Thanks for being patient with us! Looks like there was an improper usage of the tertiary if in line 15 of public/src/app.js. I've added the proper parenthesis around it which might help, and removed the vestigial "http://".

Fingers crossed this was the issue!

from nodebb.

prabhu avatar prabhu commented on May 2, 2024

I had suspected this too and tried adding the parenthesis last night. Still the same (Just tried as well). Other things I tried are:

  1. Increasing and decreasing node and socket.io versions

Can you let me know what version of node you are using?

from nodebb.

prabhu avatar prabhu commented on May 2, 2024

Some logs after enabling logging in websockets.js

Info: Base Configuration OK.
info - socket.io started
Info: Checking categories...
Info: Good.
debug - authorized
warn - handshake error No cookie transmitted
debug - authorized
warn - handshake error No cookie transmitted

from nodebb.

prabhu avatar prabhu commented on May 2, 2024

ok silly me. Chrome content settings was set to block cookies. Not sure if this is the default setting for this version of chrome. Changing the setting in chrome resolved the issue. Closing this issue.

from nodebb.

barisusakli avatar barisusakli commented on May 2, 2024

Glad you figured it out. For future reference the minimum version of nodejs required is 0.8.

from nodebb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.