-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I have modified my hackathon-starter site according to the Readme file.
After running npm start and accessing the site from a client I get the following error:
Uncaught ReferenceError: io is not defined
The error is generated by the following client code:
$(document).ready(function () {
// init socket.io
const socket = io.connect(window.location.hostname + ':3001')
socket.on('greet', (data) => {
console.log(data)
socket.emit('respond', { message: 'Hey there, server!' })
})
})
While in the hackaton-starter code there is the following line in layout.pug :
script(src='/socket.io/socket.io.js')
I don't see the same in this repo, and if try to add it it gives another error since there is no socket.io library compiled by laravel-mix .
How is socket.io supposed to be loaded in the client side? am I missing something obvious?
Thank you in advance
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels