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 'scrollHeight') #106

Open
SchunckLeonardo opened this issue Sep 11, 2024 · 0 comments

Comments

@SchunckLeonardo
Copy link

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)
  },
})
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