Skip to content

Project Did Not Work. Here Are The Fixes That Worked For Me #5

Description

@ryanv404

The project code did not function as desired when using the latest versions of the npm packages as well as the latest version of Google Chrome. Specifically, clicking on the 'New Tweets' tab showed the loading spinner continuously and resulted in multiple CORS-related errors in the console.

The 'Manage Rules' tab seems to function as expected.

The 2 main culprits appeared to be:

  1. Missing CORS options in socketIo. My fix was to set the CORS options as follows.
const io = socketIo(server,{ 
  cors: {
    origin: "http://localhost:3000"
  }
});
  1. And the use of io.emit('connect'...) in the server when that event type is reserved for the emit method. My fix was simply to delete that line.

These changes allowed the app to work for me.

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