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

Add ESM exports and split dependencies #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mentaljam
Copy link

Hi!

Thank you for maintaining this great project. While integrating it into our Next.js app, I encountered an error related to an undefined Worker. After investigating, I found that the issue was resolved when using the "unbundled" version of maplibre-cog-protocol.

This pull request introduces a patch that provides an ESM build of the package. The build excludes bundled dependencies, and I’ve separated them into devDependencies, peerDependencies, and dependencies.

Additionally, the existing UMD bundle remains unchanged to preserve backward compatibility.

@JasonDClarke
Copy link

image
I got this error, thanks

@georgemoon
Copy link

I've done some local testing with the PR suggested above and it also appears to resolve the problems I was having with reference to "Worker".

In addition I'm using [email protected] and the library appears to work fine, except if the peer dependency is referring to v4 then there is a problem of mismatching types (due to the parameters that are passed to the protocol).

Would be great if the library could be updated with this PR and enabling maplibre v5 as a peer dependency!

Otherwise excellent library, definitely solves some problems for me.

(p.s. my guess is that the above screenshotted error is related to client/server components in next, and not to the changes proposed)

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.

3 participants