Add @nanostores/preact
to ALWAYS_NOEXTERNAL
#3667
Merged
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.
Changes
Adds
@nanostores/preact
to the dreadedALWAYS_NOEXTERNAL
list.It seems
noExternal
is required for any utility package relying on Preact hooks. From testing, this is likely due to a duplicate Preact getting bundled when used in a component, with a separate Preact coming from yournode_modules
inside the offending package.Why not
@nanostores/react
?React is a UMD package, while Preact is a true ESM package. This means React will always be bundled due to Vite's heuristics, while Preact will be ignored. This is why
resolve.dedupe
does not solve the issue for Preact 😓Testing
N/A, though a "nanostores" E2E test suite is on my list!
Docs
N/A