ΠΠΎΠ³Π΄Π° Ρ Π·Π°Π³ΡΡΠΆΠ°Ρ ΠΊΠ»ΠΈΠ΅Π½ΡΡΠΊΡΡ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΡ ΡΠ»Π΅Π΄ΡΡΡΠΈΠΌ ΠΎΠ±ΡΠ°Π·ΠΎΠΌ:
I get the above error.
It points to line 4 in the file, that starts with:
I already have defined this line earlier, could that be the problem?
Richard
src="js/socket.io.js"
ΠΡΠΎ Π΄ΠΎΠ»ΠΆΠ½ΠΎ Π±ΡΡΡ src="/socket.io/socket.io.js"
Π― ΠΏΠΎΠ»ΡΡΠ°Ρ ΡΡ ΠΆΠ΅ ΠΎΡΠΈΠ±ΠΊΡ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ ΡΡΠΎΡ html-ΡΠ°ΠΉΠ»:
<!doctype html>
<html lang="en">
<head>
<!-- The first thing in any HTML file should be the charset -->
<meta charset="utf-8">
<!-- Make the page mobile compatible -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Allow installing the app to the homescreen -->
<link rel="manifest" href="manifest.json">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css">
<meta name="mobile-web-app-capable" content="yes">
<title>AP Flora</title>
</head>
<body>
<!-- The app hooks into this div -->
<div id="app"></div>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- A lot of magic happens in this file. HtmlWebpackPlugin automatically includes all assets (e.g. bundle.js, main.css) with the correct HTML tags, which is why they are missing in this HTML file. Don't add any assets here! (Check out webpackconfig.js if you want to know more) -->
<script src="/socket.io/socket.io.js"></script>
<script>
const socket = io()
console.log(`socket:`, socket)
</script>
</body>
</html>
Π§ΡΠΎ Ρ Π΄Π΅Π»Π°Ρ Π½Π΅ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΠΎ?
ΠΎΠ½ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ, ΠΊΠΎΠ³Π΄Π° Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ:
<script src="https://cdn.socket.io/socket.io-1.4.0.js"></script>
Wo, ΠΊΠ°ΠΊΠΎΠΉ _is_ ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΡΠΉ URL?
ΠΠΎΠΊΠ°Π»ΡΠ½ΡΠΉ Π²ΡΠ·ΠΎΠ² socket.io.js ΡΠ°Π±ΠΎΡΠ°Π», ΠΊΠΎΠ³Π΄Π° Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ browserify Π΄Π»Ρ ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΠΈ ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΡΡ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡΡ ΡΠ°ΠΉΠ»ΠΎΠ². ΠΡΡΠ³ΠΎΠΉ ΡΠΏΠΎΡΠΎΠ± β ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΡ Π²Π½ΡΡΡΠΈ _socket.io-client_.
Π‘Π°ΠΌΡΠΉ ΠΏΠΎΠ»Π΅Π·Π½ΡΠΉ ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΉ
ΠΎΠ½ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ, ΠΊΠΎΠ³Π΄Π° Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ:
Wo, ΠΊΠ°ΠΊΠΎΠΉ _is_ ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΡΠΉ URL?