Skip to content

Uncaught TypeError: Cannot read properties of null (reading 'scrollHeight') #106

@SchunckLeonardo

Description

@SchunckLeonardo

Using WXT Chrome Extension Web Framework 0.19.1, you get the following error from content.ts

Uncaught TypeError: Cannot read properties of null (reading 'scrollHeight')
    at getContentHeight (content.js:253:37)
    at new ScrollMonitorContainer2 (content.js:291:31)
    at content.js:417:23
    at content.js:4947:2
import './src/styles/skeletons.css'
import './src/styles/flags.css'

import scrollMonitor from 'scrollmonitor'

import { WebSocketModule } from './src/websocket'
import detectUrlChange from 'detect-url-change'

export default defineContentScript({
  matches: ['https://www.amazon.com/s?*'],
  runAt: 'document_start',

  async main() {
    const ws = new WebSocketModule()

    document.addEventListener('DOMContentLoaded', () => {
      ws.initWebSocket()

      const scrollWatcher = scrollMonitor.create('div[data-asin]')
      console.log(scrollWatcher)
    })

    detectUrlChange.on('change', ws.onChangedURL)
  },
})

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