Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shinyapp.ts:437 TypeError: Cannot read properties of null (reading 'readyState') #67

Closed
mbjohnsonmn opened this issue Sep 4, 2023 · 3 comments · Fixed by #72
Closed

Comments

@mbjohnsonmn
Copy link

Hi Jon. I've spent a long time trying to isolate this error. It appeared last Friday (9/1) without any changes to my code. I've narrowed it down to section that loops through a set of 'get_cookie' calls - nine to be exact. In the R console, I get, "Warning: Error in if: argument of length zero." Not much help. Here is the text of the full error in the browser:

shinyapp.ts:437 TypeError: Cannot read properties of null (reading 'readyState')
at e.value (shinyapp.ts:584:25)
at e.value (shinyapp.ts:459:12)
at e.value (inputBatchSender.ts:65:23)
at inputBatchSender.ts:47:19
at e. (shinyapp.ts:430:22)
at v (shinyapp.ts:5:1357)
at Generator. (shinyapp.ts:5:4174)
at Generator.next (shinyapp.ts:5:2208)
at F_ (shinyapp.ts:6:99)
at u (shinyapp.ts:7:194)

Again, not much help for me, but a comment/solution to a similar post in SO that mentions typos in JS code I recall you mentioning that you may be doing some work there?

I also noticed that the sample app in the documentation no longer works. It throws this error:
Warning: Error in set_cookie: ✖ Cannot update cookie selected_number.
ℹ HttpOnly cookies can only be updated via set_cookie_response().

As always, thanks for your great work on the package.

Morris

@jonthegeek
Copy link
Contributor

@mbjohnsonmn Have you installed the dev version of the package? Try it out if not. It isn't a final fix, but it fixes the sample app issue.

# install.packages("remotes")
remotes::install_github("r4ds/cookies")

I think something changed in Shiny timing that broke {cookies}. I'm hoping to find time to dig deep into this package again in a few weeks, HOPEFULLY I can implement a more stable fix then.

Let me know whether the dev version helps!

@mbjohnsonmn
Copy link
Author

@jonthegeek Thanks for the quick reply! No joy I am afraid, but thank you for trying.

This is a really hard one since I starting experiencing the same error behavior on two somewhat independent versions: one hosted on shinyapps.io and one a remote shiny server on a local Linux installation. And on localhost, of course. I think your hypothesis of a change in shiny or one of the other JS dependencies makes sense. A great learning opportunity, if nothing else!

@jonthegeek
Copy link
Contributor

I think this will fix your issues. Please let me know if it doesn't! I'm submitting this to CRAN in any case to fix a breaking issue in the tests, but hopefully it's a real fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants