Skip to content

Unable to resolve as a es module #144

@romanzy313

Description

@romanzy313

I want to use the client in my typescript project. But I face the following issue:

Uncaught SyntaxError: The requested module './../../../node_modules/socketcluster-client/index.js' does not provide an export named 'default' (at index.ts:1:8)

My index.ts file:
`import socketClusterClient from 'socketcluster-client';

const socket = socketClusterClient.create();`

I am using [https://open-wc.org/guides/](Open WC starter) in order to have a convenient bundle-free development. I have experienced the same issue with socket.io implementation of their client, probable because browserify library is used.

This framework is very forward looking with for await of everywhere, yet I cant import it as an ES6 module?

Cli generator works around this by doing <script type="text/javascript" src="/socketcluster-client.js"></script>, which is not how it is done these-days.

How can I solve this issue? Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions