Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to resolve as a es module #144

Open
romanzy313 opened this issue Jun 13, 2022 · 0 comments
Open

Unable to resolve as a es module #144

romanzy313 opened this issue Jun 13, 2022 · 0 comments

Comments

@romanzy313
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant