Open svnhub opened 4 months ago
Just verified the bug by building a working version locally where both @use-gesture/core
and @use-gesture/core/actions
reference the same external actions-xxxxxxxxx.esm.js
module file.
So to simplify: The issue is that @use-gesture/core
doesn't consider actions.js to be part of @use-gesture/core/actions
but instead part of itself and by default the bundler inlines the code from it regardless of whether it was added as external to the esm.sh CDN URL or not.
When using both @use-gesture/core
and @use-gesture/core/actions
in your app you then end up with two versions of actions.js - one inlined in core and one as module, causing the app to break.
i just found there is a package.json in the actions
directory, the current server can't not handle it correctly, next version this will be fixed
Failing module
https://esm.sh/@use-gesture/core@10.3.1/ accidentally bundles actions.js from https://esm.sh/@use-gesture/core@10.3.1/actions which means that variables set on the imported
actions
module are not visible inside the bundled version of it when seen fromcore
.Using https://esm.sh/@use-gesture/core@10.3.1/?external=@use-gesture/core/actions or https://esm.sh/*@use-gesture/core@10.3.1 does not fix this.
Using ?no-bundle it is clear that
core
imports https://esm.sh/v135/@use-gesture/core@10.3.1/es2022/dist/actions-fe213e88.esm.js which is a minified version of@use-gesture/core/actions
an hence even without bundling it is not possible to share variables since the source is different and when loaded it will end up in a different module instance.Additional info