Repository navigation
fix: singleton modules for consistent runtime instances - #27064
Merged
Merged
Conversation
jhoward1994
marked this pull request as ready for review
July 20, 2026 10:33
Contributor
|
Size Change: -99.2 kB (-2.96%) Total Size: 3.25 MB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
Experimental build
npx create-strapi-app@0.0.0-experimental.08c99a975cc5e5610592b41d9c853d43df960653 my-project --non-interactive --skip-cloud --no-runTo upgrade an existing app, install all |
innerdvations
approved these changes
Jul 20, 2026
innerdvations
left a comment
Contributor
There was a problem hiding this comment.
Tested npm, yarn, and pnpm with the experimental, LGTM!
This was referenced Jul 20, 2026
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does it do?
Forces the CodeMirror packages used by the JSON custom field to resolve to a single runtime instance in the admin bundle, for both the Vite and webpack bundlers.
This branch combines and supersedes two PRs that fixed the same bug two different ways, unifying them behind a single PR
Concretely:
admin-vite-singleton-modules.tslisting the CodeMirror singletons (@codemirror/state,@codemirror/view,@codemirror/language,@codemirror/lang-json,@codemirror/commands,@codemirror/lint,@uiw/react-codemirror).resolve-module.tswithgetModulePathFrom(host, mod)(cached) so singletons resolve from@strapi/design-system's closure — the package that actually externalizes and consumes CodeMirror — while admin-pinned aliases keep resolving from@strapi/admin.vite/config.ts) and webpack (webpack/config.ts), and pre-bundles them viaoptimizeDeps.include.admin-vite-optimize-exclude.tsso@uiw/react-codemirror(ESM + React peer) is never auto-excluded from pre-bundling.buildSingletonAliasEntries), andoptimizeDeps.includeuses the same resolvable subset (getResolvableSingletonModules) so it stays in lockstep withresolve.alias.@codemirror/state/@codemirror/viewversion ranges inyarn.lock.Why is it needed?
After a fresh install, opening any entry with a JSON field could crash with:
(especially in e2e tests)
Fixes #27003
Supersedes #27046 and #27007