Skip to content

"Cannot read properties of undefined (reading 'getRasterizedGlyph')" when a target element is not displayed #4560

@schoonc

Description

@schoonc

After upgrading from 4.18.0 to 5.2.1, if the mount point is not displayed (e.g. some parent has display: none), this causes an error and xterm crashes. In 4.18.0 this problem was not present.

Details

  • Browser and browser version: Vivaldi 6.1.3035.50
  • OS version: Ubuntu 23.04
  • xterm.js version: 5.2.1

Steps to reproduce

Code:

<div style="display: none" id="target"></div>
import { Terminal } from 'xterm'
import { CanvasAddon } from 'xterm-addon-canvas'

const terminal = new Terminal()
terminal.loadAddon(new CanvasAddon())
terminal.open(document.getElementById('target'))

Console output:
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions