Advanced Node and Express - passing tests but don't see expected results

Hi there.

I am working my way through Advanced Node and Express ( and have passed all the tests (done 20 lessons so far). However, although I am passing the tests I am not really seeing what the lessons say I should see.

For example, in lesson 18 (Communicate by Emitting) it says "Now, try loading up your app, authenticate, and you should see in your client console '1' representing the current user count! Try loading more clients up, and authenticating to see the number go up." I don’t see that in my console.

Lesson 20 (Authentication with Socket.IO) has me putting this code into my server.js

function onAuthorizeSuccess(data, accept) {
  console.log('successful connection to');

  accept(null, true);

function onAuthorizeFail(data, message, error, accept) {
  if (error) throw new Error(message);
  console.log('failed connection to', message);
  accept(null, false);

When I run via and press Login I get a screen like so:

My console just shows:

If I run via and press Login via Github! I get a screen like so:
and my console looks like this:

 npm start

> fcc-advanced-node-and-express@0.0.1 start
> node server.js

Listening on port 3000
  id: '112013861',
  displayName: null,
  username: 'AlanBrad',
  profileUrl: '',
  photos: [
    { value: '' }
  provider: 'github',
  _raw: '{"login":"AlanBrad","id":112013861,"node_id":"U_kgDOBq0yJQ","avatar_url":"","gravatar_id":"","url":"","html_url":"","followers_url":"","following_url":"{/other_user}","gists_url":"{/gist_id}","starred_url":"{/owner}{/repo}","subscriptions_url":"","organizations_url":"","repos_url":"","events_url":"{/privacy}","received_events_url":"","type":"User","site_admin":false,"name":null,"company":null,"blog":"","location":null,"email":null,"hireable":null,"bio":null,"twitter_username":null,"public_repos":7,"public_gists":0,"followers":0,"following":0,"created_at":"2022-08-24T18:10:24Z","updated_at":"2022-10-14T22:26:40Z"}',
  _json: {
    login: 'AlanBrad',
    id: 112013861,
    node_id: 'U_kgDOBq0yJQ',
    avatar_url: '',
    gravatar_id: '',
    url: '',
    html_url: '',
    followers_url: '',
    following_url: '{/other_user}',
    gists_url: '{/gist_id}',
    starred_url: '{/owner}{/repo}',
    subscriptions_url: '',
    organizations_url: '',
    repos_url: '',
    events_url: '{/privacy}',
    received_events_url: '',
    type: 'User',
    site_admin: false,
    name: null,
    company: null,
    blog: '',
    location: null,
    email: null,
    hireable: null,
    bio: null,
    twitter_username: null,
    public_repos: 7,
    public_gists: 0,
    followers: 0,
    following: 0,
    created_at: '2022-08-24T18:10:24Z',
    updated_at: '2022-10-14T22:26:40Z'

No mention made of any connection to (successful or otherwise).

I’m very confused and am sure I must be doing something wrong somewhere even though I’m passing the tests.

My replit code is at boilerplate-advancednode - Replit

The client console is the browser. Do you see it in the browser console?

The browser console > Ctrl + Shift + J

Thank you for replying. I tried that - here is the result - I’m afraid I don’t really understand any of it :frowning:

If I fork your code and use my own DB and OAuth App it works for me.

Try it in Chrome, it should log a number to the console when you log in with GitHub (for every time you do it it should increase the number)

Edit: In the Firefox console disable everything except the Logs (click the Errors, Warnings, Info, then click the Logs to only have that enabled).

It also seems like you have to use the “Multiprocess (Slower)” option.

Thanks for replying.

This is what I get in Chrome:

and this is what I get in Firefox:

I have solved the problem - I moved the chat route before the 404 one and moved the socket code in server.js into the database connection.

Thank you so much for taking the time to advise me - the tip about the browser console really helped

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.