I'm importing import { io } from "./socket.io-client"; at the top of app.js, but I get this error SyntaxError: import declarations may only appear at top level of a module. I have a script tag under body like this:
<script src="app.js"></script>
What should I do to fix the error?