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

[Bug]: Uncaught RangeError: Selection points outside of document #796

Closed
sabertazimi opened this issue May 4, 2022 · 0 comments · Fixed by #797
Closed

[Bug]: Uncaught RangeError: Selection points outside of document #796

sabertazimi opened this issue May 4, 2022 · 0 comments · Fixed by #797
Assignees
Labels
bug Something isn't working todo 🗒️

Comments

@sabertazimi
Copy link
Owner

sabertazimi commented May 4, 2022

https://github.com/codesandbox/sandpack/blob/d7c1993257a80a69a53b304c6e5c3b794b7ad0cd/sandpack-react/src/components/CodeEditor/CodeMirror.tsx#L241-L244

https://github.com/codemirror/state/blob/536613d40d0f95ad8dd15f8a0b1d8e478ffe508e/src/state.ts#L240-L251

https://github.com/codemirror/state/blob/536613d40d0f95ad8dd15f8a0b1d8e478ffe508e/src/selection.ts#L223-L226

https://github.com/codemirror/state/blob/536613d40d0f95ad8dd15f8a0b1d8e478ffe508e/src/text.ts#L162-L165

https://github.com/codemirror/state/blob/536613d40d0f95ad8dd15f8a0b1d8e478ffe508e/src/text.ts#L370-L374

class TextLeaf extends Text {
  constructor(
    readonly text: readonly string[],
    readonly length: number = textLength(text)
  ) {
    super();
  }
}

function textLength(text: readonly string[]) {
  let length = -1;
  for (let line of text) length += line.length + 1;
  return length;
}
class f extends b {
  constructor(
    a,
    b = (function (a) {
      for (let b of a) b.length;
      return -1; // SWC minifier bug here!!!
    })(a)
  ) {
    super(), (this.text = a), (this.length = b);
  }
}
@sabertazimi sabertazimi added bug Something isn't working todo 🗒️ labels May 4, 2022
@sabertazimi sabertazimi self-assigned this May 4, 2022
sabertazimi added a commit that referenced this issue May 4, 2022
@sabertazimi sabertazimi pinned this issue May 5, 2022
sabertazimi added a commit that referenced this issue May 28, 2022
sabertazimi added a commit that referenced this issue Oct 30, 2022
issue #796
issue vercel/nextjs#40889
sabertazimi added a commit that referenced this issue Oct 30, 2022
* fix(deps): update dependency next to ^12.3.1
* fix(swc): disable swc minifier

issue #796
issue vercel/nextjs#40889

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: sabertazimi <sabertazimi@gmail.com>
@sabertazimi sabertazimi unpinned this issue Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working todo 🗒️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant