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

Fix cjs imports for modules #495

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

Conversation

danielfdsilva
Copy link

When bundling an app with parcel, if package exports are enabled, importing threads causes an error.

This happens because when following package exports, parcel expects the module to use default exports if a default import is being used.

The files dist/observable.js, dist/index.js, dist/worker/index.js offer only named exports, so trying to import a default (eg import Threads from "./dist/index.js") fails.

Using a * import is a safer way to handle this across bundlers.

@danielfdsilva danielfdsilva marked this pull request as draft January 14, 2025 14:55
@danielfdsilva danielfdsilva marked this pull request as ready for review January 14, 2025 18:20
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.

1 participant