Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

remove decentralandLibrary and exports #123

Open
wants to merge 1 commit into
base: decentraland-sdk7
Choose a base branch
from

Conversation

gonpombo8
Copy link

ts error when importing file from dist path: The path "./dist/colyseus-decentraland" is not exported by package "colyseus.js":

ts error when importing file from dist path:  `The path "./dist/colyseus-decentraland" is not exported by package "colyseus.js":`
@endel
Copy link
Member

endel commented May 4, 2023

Hi @gonpombo8. I'm not too familiar with the latest SDK7 on Decentraland, can you provide more background info, and how to reproduce the issue?

The "exports" field is mandatory for most javascript build tooling, and "decentralandLibrary" is (was?) the way to specify module entrypoint for Decentraland.

Cheers

endel added a commit that referenced this pull request May 5, 2023
@endel
Copy link
Member

endel commented May 5, 2023

Hi @gonpombo8, I see! Thanks for the details.

Can you try colyseus.js@0.15.2? I've added a "./decentraland" export.

It should be possible to import like this now:

import { Client, Room } from "colyseus.js/decentraland";

@gonpombo8
Copy link
Author

Hi @gonpombo8. I'm not too familiar with the latest SDK7 on Decentraland, can you provide more background info, and how to reproduce the issue?

The "exports" field is mandatory for most javascript build tooling, and "decentralandLibrary" is (was?) the way to specify module entrypoint for Decentraland.

Cheers

Hi @endel. Yes, sure. Thanks for the response. 😁

We are using esbuild for the build process for the scenes and we can import any file/package now, so the decentralandLibrary is no needed anymore for the SDK7.

If I try to import directly the file colyseus-decentraland.js from the dist folder then i get an error because the exports field defined of the package.json. Maybe we can still have the decentralandLibrary for the sdk6, but can we change the entryPoint of the exports so it points directly to the dist/decentraland-colyseus.js or remove the exports at all ?

Here is the error to have more context:
image

@gonpombo8
Copy link
Author

Hi @gonpombo8, I see! Thanks for the details.

Can you try colyseus.js@0.15.2? I've added a "./decentraland" export.

It should be possible to import like this now:

import { Client, Room } from "colyseus.js/decentraland";

THANKS!!!! 🤍
Now it works and bundles right, the only thing that I'm seeing is this new error. Maybe its related to the changes on the function send to use fetch ?
image

@endel
Copy link
Member

endel commented May 5, 2023

Hard to say what's the issue there. Can you send me the final build so I can take a look? If you'd like to we can chat via Discord to speed this up (my user is endel#2163)

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

Successfully merging this pull request may close these issues.

None yet

2 participants