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 'offsetWidth') #132

Open
pySilver opened this issue Aug 26, 2022 · 1 comment

Comments

@pySilver
Copy link

Hi! Not sure what I'm doing wrong here

this.instance = new PinchZoom(this.element, {});

gives:

pinch-zoom.js?0bd1:517 Uncaught TypeError: Cannot read properties of null (reading 'offsetWidth')
    at PinchZoom.getInitialZoomFactor (pinch-zoom.js?0bd1:517:1)
    at PinchZoom.eval (pinch-zoom.js?0bd1:702:1)
getInitialZoomFactor @ pinch-zoom.js?0bd1:517
eval @ pinch-zoom.js?0bd1:702
setTimeout (async)
update @ pinch-zoom.js?0bd1:699
PinchZoom @ pinch-zoom.js?0bd1:102
eval @ pinch_zoom_controller.js?538c:14
setTimeout (async)
connect @ pinch_zoom_controller.js?538c:13
connect @ stimulus.js?73bd:1086
connectContextForScope @ stimulus.js?73bd:1278
scopeConnected @ stimulus.js?73bd:1593
elementMatchedValue @ stimulus.js?73bd:1513
tokenMatched @ stimulus.js?73bd:804
tokenMatched @ stimulus.js?73bd:737
eval @ stimulus.js?73bd:731
tokensMatched @ stimulus.js?73bd:731
elementMatchedAttribute @ stimulus.js?73bd:720
elementMatched @ stimulus.js?73bd:498
addElement @ stimulus.js?73bd:446
refresh @ stimulus.js?73bd:367
start @ stimulus.js?73bd:337
start @ stimulus.js?73bd:474
start @ stimulus.js?73bd:702
start @ stimulus.js?73bd:785
start @ stimulus.js?73bd:1491
start @ stimulus.js?73bd:1561
start @ stimulus.js?73bd:1645
await in start (async)
start @ stimulus.js?73bd:1638
eval @ app.js?cd18:7
./src/js/app.js @ app.js:679
__webpack_require__ @ app.js:1019
(anonymous) @ app.js:1148
__webpack_require__.O @ app.js:1053
(anonymous) @ app.js:1150
(anonymous) @ app.js:1152
pinch-zoom.js?0bd1:633 Uncaught TypeError: Cannot read properties of null (reading 'style')
    at PinchZoom.unsetContainerY (pinch-zoom.js?0bd1:633:1)
    at PinchZoom.updateAspectRatio (pinch-zoom.js?0bd1:508:1)
    at PinchZoom.update (pinch-zoom.js?0bd1:690:1)
@sandstrom
Copy link
Collaborator

Hello Silver! Since this code is open-source, without anyone getting paid to work on it, it's difficult to satisfy help out with issues like this. I hope you understand! 🌻

But if you want to dig in and investigate what's causing this, maybe you can help out and improve the project?

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

2 participants