Repository navigation
Closed
Closed
Copy link
Labels
Description
Bug
The gh-aw Playground editor fails to initialize the CodeMirror editors. The page loads but shows "Loading..." indefinitely with no editor content.
Console Error
Unrecognized extension value in extension set ([object Object]).
This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.
at editor.js:119 (new EditorView({...}))
Root Cause
docs/public/editor/editor.js pins specific old versions of CodeMirror packages:
import { EditorView, basicSetup } from 'https://esm.sh/[email protected]';
import { EditorState, Compartment } from 'https://esm.sh/@codemirror/[email protected]';
import { keymap } from 'https://esm.sh/@codemirror/[email protected]';
import { indentUnit } from 'https://esm.sh/@codemirror/[email protected]';However, esm.sh resolves transitive dependencies to the latest matching semver. For example:
@codemirror/[email protected](resolved by[email protected]via^6.0.0) depends on@codemirror/state@^6.6.0- This pulls in
@codemirror/[email protected]as a separate module from the pinned@codemirror/[email protected]
Two instances of @codemirror/state are loaded simultaneously, which breaks instanceof checks used internally by CodeMirror.
Observed duplicate versions (from network requests)
| Package | Pinned (editor.js) | Transitive (esm.sh) |
|---|---|---|
@codemirror/state |
6.5.4 | 6.6.0 |
@codemirror/view |
6.39.14 | 6.41.0 |
@codemirror/language |
6.12.1 | 6.12.3 |
Suggested Fix
Update the pinned versions in docs/public/editor/editor.js to match the latest versions that transitive deps resolve to:
import { EditorState, Compartment } from 'https://esm.sh/@codemirror/[email protected]';
import { keymap } from 'https://esm.sh/@codemirror/[email protected]';
import { indentUnit } from 'https://esm.sh/@codemirror/[email protected]';This will break again over time as esm.sh resolves newer transitive versions. A more durable fix would be to either:
- Use esm.sh import maps or
?deps=params to force version alignment - Bundle the editor with a proper package manager instead of relying on esm.sh CDN resolution
Reacted by Peli de Halleux
Reacted by Copilot
Activity
Mossaka commentedon Apr 8, 2026
Going to research on how to make the editor dep free
github-actions commentedon Apr 9, 2026
🏷️ Issue Triaged
Hi
@Mossaka! I've categorized this issue as bug based on the following analysis:Reasoning: The playground editor fails to load due to duplicate
@codemirror/stateversions from the esm.sh CDN, causing a runtime error — this is a clear regression/breakage in existing functionality.View Triage Details
Analysis
Recommended Next Steps
@codemirror/statedependency in the esm.sh import mapReferences: Triage run §24197644015
Note
🔒 Integrity filter blocked 15 items
The following items were blocked because they don't meet the GitHub integrity level.
list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".discussions: writepermission to safe-output jobs #25467list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".conclusionjob uses static concurrency group, causing random cancellations in batch dispatches #25420list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".ACTIONS_ID_TOKEN_REQUEST_URL/ACTIONS_ID_TOKEN_REQUEST_TOKENenv vars #25224list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".git am#25130list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".claude-codeto a verified version and restrict sandbox env/network for npm operations #25101list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:Tarekchehahde commentedon Jul 11, 2026
This was fixed upstream on 2026-04-09 by removing the CodeMirror/esm.sh dependency entirely.
Merged fix: #25387 — replaces CodeMirror with a dependency-free
<textarea>editor (same approach Mossaka noted in the thread).Current playground at https://github.github.com/gh-aw/editor/ ships that implementation (
docs/public/editor/editor.js— no@codemirror/*imports).Recommend closing #25381 as resolved by #25387.