I'd like to import the socket.io-client library as ES6 import.
Using following import syntax:
import io from 'socket.io-client.js';
returns the error Requested module does not provide an export".
As a workaround I was using following code to create a module from the socket.io code:
// import 'https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js'; import './socket.io-client.js'; export default globalThis.io;
But the error message this time says "Cannot set property 'io' of undefined."
So to my question - Is there any possibility to import socket.io on the client-browser side via ES6 imports?
Note that I'd really like to avoid using < script >-tags, loading the code myself or loading by require.js, browserify and co!