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

Uncaught TypeError: Cannot read properties of null (reading 'removeChild') in XTerm component with Next.js 15.2.2 and React 19.0.0 #7

Open
franc1sjacob opened this issue Mar 24, 2025 · 0 comments

Comments

@franc1sjacob
Copy link

I'm encountering an issue where I get a nonstop error when saving changes in the component where the XTerm terminal component is used. The error message is:

react-dom-client.development.js:11457 Uncaught TypeError: Cannot read properties of null (reading 'removeChild')

The issue occurs whenever I make any changes and save the component containing the XTerm component. The error prevents proper rendering and causes the app to loop.

My implementation:

"use client";

import { FitAddon } from "@xterm/addon-fit";
import { XTerm } from "react-xtermjs";

const Terminal = () => {
  const fitAddon = new FitAddon();

  return (
    <XTerm
      addons={[fitAddon]}
      options={{ fontSize: 12 }}
      style={{ width: "100%", height: "100%" }}
    />
  );
};

export default Terminal;

Using the component:

const Terminal = dynamic(() => import("./terminal"), {
  ssr: false,
  loading: () => <div>Loading terminal...</div>,
});
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