bigskysoftware / htmx-extensions

164 stars 50 forks source link

fix ws: `undefined is not an object (evaluating 'api.getInternalData(elt).webSocket.close')` #109

Open enigma opened 1 week ago

enigma commented 1 week ago

This PR fixes #96 by checking whether webSocket is set. A similar check happens at L46 on the same file.

netlify[bot] commented 1 week ago

Deploy Preview for htmx-extensions canceled.

Name Link
Latest commit 963eaff841c30d81d4ee5d69e81d5f0133a54052
Latest deploy log https://app.netlify.com/sites/htmx-extensions/deploys/673719cf0dd22e0008e70f95
Telroshan commented 1 week ago

Hey, thanks for the fix! Would you mind adding a test case, to avoid any potentiel regression in the future ? You would need to make sure the test case fails with the current state, then that it succeeds with your fix

enigma commented 1 week ago

Hey, thanks for the fix! Would you mind adding a test case, to avoid any potentiel regression in the future ? You would need to make sure the test case fails with the current state, then that it succeeds with your fix

Thank you @Telroshan - please take another look.