kuceb/cypress-plugin-tab

Cannot read property '0' of null

AndrewLeedham opened this issue · 8 comments

It seems that some recent browser changes have started causing issues in platform.js which is a dependency of a11y.js used here. More details can be seen on the platform.js issue here: bestiejs/platform.js#196. It seems a11y.js hasn't been touched for 5 years and platform.js for 2. So I doubt they will get patched anytime soon. Given this package only uses 1 method from a11y.js it seems like we could probably just include that functionality internally, and removed the need for any dependencies?

We ran into this problem when we upgraded the project from vue-cli to vite.
The changes from your PR are working fine.
Thanks for all the effort you put in!

@renevanderheijden just curious how you tested the PR changes were fine since the PR changes are not published to npm?
DId you build the branch locally as a tarball and reference it from your project?

having the same issues after moving to vite as well........

@wingy3181 As I don't expect that this package will be updated anytime soon, I just removed the cypress-plugin-tab package from the project and made a local implementation.

I copied index.js to our project, and updated our Cypress Chainable interface with the content of index.d.ts to add TypeScript support. After that our tests were running fine again, and with less external dependencies.

@wingy3181 We use patch-package to make small changes to dependencies. Or if you use pnpm it has patching built in.

@renevanderheijden @AndrewLeedham Thanks for your quick replies.....
i did think about using patch package but was surprised that it also picks up the packge.json changes.....it worked for me as well...so thanks again @AndrewLeedham for the effort put in

was weighing up the discussions in cypress-io/cypress#299 and whether i should use https://github.com/dmtrKovalenko/cypress-real-events instead.......

@wingy3181 We did actually move to cypress-real-events, but that was because of the Cypress 10 compatibility rather than this issue.

@AndrewLeedham what kind of Cypress 10 compatibility issues? how are you finding it? i just know its limited to chromium browsers and is using native events so its more realistic? we are using cypress 11 and just at the beginning of writing some e2e tests... so too early to tell but would be good to know so i can pre-emptively assess it....

@wingy3181 see #61. Nothing bad to say about cypress-real-events, has been great for us.