You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When navigate to a page that has img element with loading attribute, the page crashed and showing "read properties of undefined (reading 'loading')" in console.
Uncaught TypeError: Cannot read properties of undefined (reading 'loading')
in +layout.svelte
in root.svelte
at Module.handle_lazy_img (chunk-5S7XBGTN.js?v=925f45c9:1586:30)
at _page (+page.svelte:34:23)
at chunk-5S7XBGTN.js?v=925f45c9:222:58
at update_reaction (chunk-GFV2NITQ.js?v=925f45c9:889:23)
at update_effect (chunk-GFV2NITQ.js?v=925f45c9:980:21)
at create_effect (chunk-GFV2NITQ.js?v=925f45c9:1992:7)
at branch (chunk-GFV2NITQ.js?v=925f45c9:2124:10)
at chunk-5S7XBGTN.js?v=925f45c9:216:17
at update_reaction (chunk-GFV2NITQ.js?v=925f45c9:889:23)
at update_effect (:5173/node_modules/.vite/deps/chunk-GFV2NITQ.js?v=925f45c9:980:21)TypeError: Cannot read properties of undefined (reading 'loading')
at Module.handle_lazy_img (chunk-5S7XBGTN.js?v=925f45c9:1586:30)
at _page (+page.svelte:34:23)
at chunk-5S7XBGTN.js?v=925f45c9:222:58
at update_reaction (chunk-GFV2NITQ.js?v=925f45c9:889:23)
at update_effect (chunk-GFV2NITQ.js?v=925f45c9:980:21)
at create_effect (chunk-GFV2NITQ.js?v=925f45c9:1992:7)
at branch (chunk-GFV2NITQ.js?v=925f45c9:2124:10)
at chunk-5S7XBGTN.js?v=925f45c9:216:17
at update_reaction (chunk-GFV2NITQ.js?v=925f45c9:889:23)
at update_effect (chunk-GFV2NITQ.js?v=925f45c9:980:21)
If there is just the image, it works; the generated code passes the element correctly:
varimg=root();$.handle_lazy_img(img);
With an additional element, no variable for the image is generated and the call becomes empty 🤔
varfragment=root();$.next(2);$.handle_lazy_img();
I guess a check is missing to get an element reference in case there isn't one yet. E.g. passing in a src attribute from code or binding the image element will also make it work, so it just breaks in the completely static case since nothing else generates the variable.
Describe the bug
When navigate to a page that has img element with loading attribute, the page crashed and showing "read properties of undefined (reading 'loading')" in console.
Reproduction
https://svelte.dev/playground/fd9fd756b9c942f18f5c9364a8c46454?version=5.1.13
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: