Set up the Environment

error
TypeError: io is not a function

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0.

Challenge: Set up the Environment

Link to the challenge:

Heya~!

I saw you added this code snippet to your server.js, but it actually needs to go in your client.js :slight_smile:

1 Like

I added it but still error

You do not need to create a new client.js file - there is one for you in the public folder. :slight_smile:

1 Like

like this ?

$( document ).ready(function() {
  
  let socket = io();
   
  // Form submittion with new message in field with id 'm'
  $('form').submit(function(){
    var messageToSend = $('#m').val();
    //send message to server here?
    $('#m').val('');
    return false; // prevent form submit from refreshing page
  });
  
});

Yes but you are missing that comment that the instructions say you need. :slight_smile:

1 Like

added it but still :pleading_face:

Can you share the error you are getting? Have you tried submitting the project to the challenge page?

digged into the old fcc forum posts found adding

const cors = require('cors');
app.use(cors());

is the solution