Closed WJAir closed 1 year ago
As inscrutable as this issue is, I'm having the same issue after freshly adding this plugin to my new Docusaurus site, and this is the only existing reference I've found to this error (so far). In text form for easier parsing:
Cannot read properties of null (reading 'content')
TypeError: Cannot read properties of null (reading 'content')
at eval (webpack-internal:///./node_modules/plugin-image-zoom/node_modules/medium-zoom/dist/medium-zoom.esm.js:391:46)
at new Promise (<anonymous>)
at open (webpack-internal:///./node_modules/plugin-image-zoom/node_modules/medium-zoom/dist/medium-zoom.esm.js:346:12)
at toggle (webpack-internal:///./node_modules/plugin-image-zoom/node_modules/medium-zoom/dist/medium-zoom.esm.js:537:12)
at HTMLDocument._handleClick (webpack-internal:///./node_modules/plugin-image-zoom/node_modules/medium-zoom/dist/medium-zoom.esm.js:135:5)
@WJAir did you close this issue because you found a solve? If so, please share with the class 😄
Solved. For the next person to reach this issue, you might have done as I did and copied the example config from the README without reading the documentation referenced in the inline comments.
Long story short: remove or comment the container
and template
options from imageZoom.options
until you've read those docs and created the required elements.
Request that the maintainer (@ataft ?) Rename this issue to something like Cannot read properties of null (reading 'content')
to make it easier to find this for the next dummy like me.
I used the same configuration as in the example, but clicked the image incorrectly