usablica / intro.js

Lightweight, user-friendly onboarding tour library
http://introjs.com
Other
22.67k stars 2.59k forks source link

fix: `cloneObject` when `window.jQuery` set but null/undefined #2029

Closed atoff closed 2 months ago

atoff commented 7 months ago

I encountered a problem when testing locally with intro.js whereby (for some reason) window.jQuery was set on my browser to undefined. This causes an exception in cloneObject as it tries to use the value for an instance of comparison. image

My app doesn't use jQuery, so not sure where it is coming from, but either way I think we need to assert that window.jQuery is non-nullable before continuing to the instanceof.

I only encountered this problem when defining the steps option, as cloneObject is used to clone the input.

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
intro-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2023 9:22pm
kingsloi commented 4 months ago

cheers @atoff! I was running into the same issue using intro.js with a project made in the TALL stack.

@jeroensijbom I see you approved this PR recently, but is there any update on when it'll be merged? I'm not able to use the intro.js without first including jQuery, which the project I'm using intro.js in doesn't use, so we're loading jQuery to not really use it, and removing it breaks it 🙏

atoff commented 4 months ago

cheers @atoff! I was running into the same issue using intro.js with a project made in the TALL stack.

@jeroensijbom I see you approved this PR recently, but is there any update on when it'll be merged? I'm not able to use the intro.js without first including jQuery, which the project I'm using intro.js in doesn't use, so we're loading jQuery to not really use it, and removing it breaks it 🙏

Workaround I am using at the moment is including

  delete window.jQuery

when I bootstrap my application / use intro.js in a component - should work for you until this is merged and released!

kingsloi commented 4 months ago

Workaround I am using at the moment is including

  delete window.jQuery

when I bootstrap my application / use intro.js in a component - should work for you until this is merged and released!

Amazing @atoff! Worked a treat - cheers sir! 🍻