Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeMirror] Crash in drawSelection extension #1065

Open
microbit-matt-hillsdon opened this issue Nov 4, 2022 · 0 comments
Open

[CodeMirror] Crash in drawSelection extension #1065

microbit-matt-hillsdon opened this issue Nov 4, 2022 · 0 comments

Comments

@microbit-matt-hillsdon
Copy link
Collaborator

microbit-matt-hillsdon commented Nov 4, 2022

This one happened immediately on navigating to, but not opening, the Dice Idea.

I guess it's possible it is the read-only CM in the sidebar.

TypeError: Cannot read properties of null (reading 'top')
  at addSpan(../node_modules/@codemirror/view/dist/index.js:7415:39)
  at drawForLine(../node_modules/@codemirror/view/dist/index.js:7441:13)
  at measureRange(../node_modules/@codemirror/view/dist/index.js:7387:33)
  at ? (../node_modules/@codemirror/view/dist/index.js:7299:74)
  at Array.map(<anonymous>)
  at read(../node_modules/@codemirror/view/dist/index.js:7299:50)
  at ? (../node_modules/@codemirror/view/dist/index.js:6380:34)
  at Array.map(<anonymous>)
  at measure(../node_modules/@codemirror/view/dist/index.js:6378:42)
  at wrappedArguments(../node_modules/@codemirror/view/dist/index.js:6505:79)
  at i(../../../../browser/src/helpers.ts:73:23)

On the face of it none of our code is involved in this one.

The line in question seems to be something of a hack, it uses any in the TypeScript source to allow it to pass 2 or -2 as the side parameter. This seems to be a kind of internal API, 2/-2 are special cased even though they're not valid according to the parameter types.

Let's see if we can come up with a repro.

Chrome 107/Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant