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

Dual package hazard #448

Closed
Tofandel opened this issue Dec 9, 2024 · 1 comment · Fixed by #449
Closed

Dual package hazard #448

Tofandel opened this issue Dec 9, 2024 · 1 comment · Fixed by #449

Comments

@Tofandel
Copy link
Contributor

Tofandel commented Dec 9, 2024

Currently both ESM and CJS are exported but they do not share state

That means the exported Symbol('carousel') can have 3 different instances (because there is also a CJS minified version) and causes issue if one component is imported from ESM and the other one from CJS

@Tofandel
Copy link
Contributor Author

Tofandel commented Dec 9, 2024

Ok the issue is not actually because of the dual package hazard

The injection key is bundled twice in the same file, eg in dist/carousel.es.js

// Use a symbol for inject provide to avoid any kind of collision with another lib
// https://vuejs.org/guide/components/provide-inject#working-with-symbol-keys
const injectCarousel$1 = Symbol('carousel');



// Use a symbol for inject provide to avoid any kind of collision with another lib
// https://vuejs.org/guide/components/provide-inject#working-with-symbol-keys
const injectCarousel = Symbol('carousel');

One is exported, the second one is used within the components

Seems in the merge from #435 the injectSymbols file got duplicated in both @/shared/injectSymbols.ts and @/injectSymbols.ts

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 a pull request may close this issue.

1 participant