Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket.io não prove um export padrão #61

Open
FlavioZanoni opened this issue Jan 18, 2021 · 1 comment
Open

socket.io não prove um export padrão #61

FlavioZanoni opened this issue Jan 18, 2021 · 1 comment

Comments

@FlavioZanoni
Copy link

FlavioZanoni commented Jan 18, 2021

eu tava tentando abrir somente o servidor para uns testes

import express from 'express'
import http from 'http'
import socketio from 'socket.io'


const app = express()
const server = http.createServer(app)
const sockets = socketio(server)

app.use(express.static('public'))

server.listen(8080, () => {
    console.log(`> Server listening on port: 8080`)
})

mas eu recebo o erro

import socketio from 'socket.io'
      ^^^^^^^^
SyntaxError: The requested module 'socket.io' does not provide an export named 'default'

como eu resolvo?

@ghost
Copy link

ghost commented Jan 31, 2021

em vez de "socketio", use "socketIo"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant