Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TypeError: Cannot read properties of undefined (reading 'trim') #102

Copy link
Copy link
Open
@Billy-Sheppard

Description

@Billy-Sheppard
Issue body actions

Describe the bug
JS console error from highlightjs-line-numbers.min.js.

To Reproduce
Steps to reproduce the behavior:

...
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/vs2015.min.css" integrity="sha512-mtXspRdOWHCYp+f4c7CkWGYPPRAhq9X+xCvJMUBVAb6pqA4U8pxhT3RWT3LP3bKbiolYL2CkL1bSKZZO4eeTew==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha512-D9gUyxqja7hBtkWpPWGt9wfbfaMGVt9gnyCvYa+jojwwPHLCzUm5i8rpk7vD7wNee9bA35eYIjobYPaQuKS1MQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js" integrity="sha512-axd5V66bnXpNVQzm1c7u1M614TVRXXtouyWCE+eMYl8ALK8ePJEs96Xtx7VVrPBc0UraCn63U1+ARFI3ofW+aA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
...

Have this in your HTML, use highlightjs (and line-numbers). Prints this to console.

highlightjs-line-numbers.min.js:1  
Uncaught TypeError: Cannot read properties of undefined (reading 'trim')
    at highlightjs-line-numbers.min.js:1:1620
    at f (highlightjs-line-numbers.min.js:1:1932)
    at highlightjs-line-numbers.min.js:1:1004

Expected behavior
No errors.

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser [e.g. chrome, safari]: Edge
  • Version [e.g. 22]: 125.0.2535.79

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.