🐛 Directs Vue Reactivity Import to Browser Version #3602
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
As mentioned here and some other places, for people using outdated CDN systems for their JS, no longer bundling dependencies has caused some issues with @vue/reactivity.
Vue reactivity points to a version that is for the server, and bundlers are smart enough to handle this (and instead use the provided browser version right next to it).
However, some cdns that let people add packages in the browser do not do these kinds of checks, causing a failure.
Alpine used to prebundle all the dependencies, which masked this issue as Alpine's build step was handling this negotiation. However, prebundling dependencies is generally a bad practice as it can increase unneeded code duplication and reduce consumer control.
Solution
This
solvesshould solve the problem by pointing the imports directly at the browser safe version of the module so that modern bundlers, and outdated systems alike can use the correct browser-safe version of the reactivity engine.