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] Occasional occurrence Uncaught TypeError: Cannot read properties of null (reading 'pushEditOperations') #4511

Open
1 of 2 tasks
song-xiao-lin opened this issue May 16, 2024 · 0 comments

Comments

@song-xiao-lin
Copy link

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

Reproduction Steps

No response

Actual (Problematic) Behavior

No response

Expected Behavior

No response

Additional Context

editor.tsx:106 Uncaught TypeError: Cannot read properties of null (reading 'pushEditOperations')
at editor.tsx:106:1
at commitHookEffectListMount (react-dom.development.js:23150:1)
at commitPassiveMountOnFiber (react-dom.development.js:24926:1)
at commitPassiveMountEffects_complete (react-dom.development.js:24891:1)
at commitPassiveMountEffects_begin (react-dom.development.js:24878:1)
at commitPassiveMountEffects (react-dom.development.js:24866:1)
at flushPassiveEffectsImpl (react-dom.development.js:27039:1)
at flushPassiveEffects (react-dom.development.js:26984:1)
at performSyncWorkOnRoot (react-dom.development.js:26076:1)
at flushSyncCallbacks (react-dom.development.js:12042:1)
(anonymous) @ editor.tsx:106
commitHookEffectListMount @ react-dom.development.js:23150
commitPassiveMountOnFiber @ react-dom.development.js:24926
commitPassiveMountEffects_complete @ react-dom.development.js:24891
commitPassiveMountEffects_begin @ react-dom.development.js:24878
commitPassiveMountEffects @ react-dom.development.js:24866
flushPassiveEffectsImpl @ react-dom.development.js:27039
flushPassiveEffects @ react-dom.development.js:26984
performSyncWorkOnRoot @ react-dom.development.js:26076
flushSyncCallbacks @ react-dom.development.js:12042
flushSyncCallbacksOnlyInLegacyMode @ react-dom.development.js:12021
batchedUpdates$1 @ react-dom.development.js:26148
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchContinuousEvent @ react-dom.development.js:6444

useEffect(() => {
if (editor.current) {
if (value === editor.current.getValue()) {
return;
}

  const model = editor.current.getModel();
  __prevent_trigger_change_event.current = true;
  editor.current.pushUndoStop();
  // pushEditOperations says it expects a cursorComputer, but doesn't seem to need one.
  model.pushEditOperations(
    [],
    [
      {
        range: model.getFullModelRange(),
        text: value,
      },
    ],
    undefined
  );
  editor.current.pushUndoStop();
  __prevent_trigger_change_event.current = false;
}

}, [value]);

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