I have some problem with web app which connects to minecraft terminal server:
/say test
Error: Rcon is not a constructor

My project:
Console.js:
import React, { useState, useEffect, useRef } from 'react';
import { io } from 'socket.io-client';
import {
  Box,
  TextField,
  Typography,
  Paper,
  IconButton,
  InputAdornment
} from '@mui/material';
import SendIcon from '@mui/icons-material/Send';

const Console = () => {
  const [logs, setLogs] = useState([]);
  const [command, setCommand] = useState('');
  const [socket, setSocket] = useState(null);
  const logsEndRef = useRef(null);

  useEffect(() => {
    const newSocket = io('http://localhost:3001');
    
    newSocket.on('console-output', (log) => {
      setLogs(prev => [...prev, log]);
    });

    newSocket.on('command-result', (result) => {
      if (result.success) {
        setLogs(prev => [...prev, `> ${result.result}`]);
      } else {
        setLogs(prev => [...prev, `Error: ${result.error}`]);
      }
    });

    setSocket(newSocket);

    return () => newSocket.close();
  }, []);

  useEffect(() => {
    logsEndRef.current?.scrollIntoView({ behavior: 'smooth' });
  }, [logs]);

  const handleSendCommand = () => {
    if (command.trim() && socket) {
      socket.emit('command', command);
      setLogs(prev => [...prev, `> ${command}`]);
      setCommand('');
    }
  };

  const handleKeyPress = (e) => {
    if (e.key === 'Enter') {
      handleSendCommand();
    }
  };

  return (
    <Box>
      <Typography variant="h5" gutterBottom>
        Server Console
      </Typography>
      
      <Paper
        variant="outlined"
        sx={{
          height: 400,
          overflow: 'auto',
          p: 2,
          mb: 2,
          backgroundColor: '#1e1e1e',
          color: '#ffffff',
          fontFamily: 'monospace',
          fontSize: '0.9rem'
        }}
      >
        {logs.map((log, index) => (
          <div key={index} style={{ marginBottom: '4px' }}>
            {log}
          </div>
        ))}
        <div ref={logsEndRef} />
      </Paper>

      <TextField
        fullWidth
        value={command}
        onChange={(e) => setCommand(e.target.value)}
        onKeyPress={handleKeyPress}
        placeholder="Enter Minecraft command (e.g., 'say Hello World' or '/gamemode creative')"
        InputProps={{
          endAdornment: (
            <InputAdornment position="end">
              <IconButton onClick={handleSendCommand} edge="end">
                <SendIcon />
              </IconButton>
            </InputAdornment>
          )
        }}
      />
    </Box>
  );
};

export default Console;

App.js:
import React from 'react';
import { BrowserRouter as Router, Routes, Route, Link } from 'react-router-dom';
import { ThemeProvider } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import {
  AppBar,
  Toolbar,
  Typography,
  Container,
  Box,
  Button,
  Paper
} from '@mui/material';
import TerminalIcon from '@mui/icons-material/Terminal';
import SettingsIcon from '@mui/icons-material/Settings';
import theme from './theme';
import Console from './components/Console';
import Settings from './components/Settings';

function App() {
  return (
    <ThemeProvider theme={theme}>
      <CssBaseline />
      <Router>
        <Box sx={{ flexGrow: 1 }}>
          <AppBar position="static">
            <Toolbar>
              <Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
                Minecraft Server Manager
              </Typography>
              <Button
                color="inherit"
                startIcon={<TerminalIcon />}
                component={Link}
                to="/"
              >
                Console
              </Button>
              <Button
                color="inherit"
                startIcon={<SettingsIcon />}
                component={Link}
                to="/settings"
              >
                Settings
              </Button>
            </Toolbar>
          </AppBar>

          <Container maxWidth="lg" sx={{ mt: 4 }}>
            <Paper elevation={3} sx={{ p: 3 }}>
              <Routes>
                <Route path="/" element={<Console />} />
                <Route path="/settings" element={<Settings />} />
              </Routes>
            </Paper>
          </Container>
        </Box>
      </Router>
    </ThemeProvider>
  );
}

export default App;