posit-dev / r-shinylive

https://posit-dev.github.io/r-shinylive/
Other
151 stars 16 forks source link

Tinker editor console loads with error: there is no package called ‘httpuv’ #44

Closed coatless closed 8 months ago

coatless commented 8 months ago

Visit any example here:

https://shinylive.io/r/examples/#hello-shiny

Receive:

shinylive-r-editor-error

Maybe related to the new shinylive version?

georgestagg commented 8 months ago

Hi,

Does reloading with an empty browser cache help? In Chrome you can do this easily by right-clicking the refresh button near the address bar.

If it still fails after clearing the cache, could you load up the network tab and JavaScript console in the browser dev tools and let us know if there are any error messages or network connection failures in the logs as the page loads?

coatless commented 8 months ago

Unfortunately, no. I tried both the local setting and completely deleting all data.

Local page reset:

shinylive-reset-website-data-url-bar

Browser hard reset:

shinylive-hard-browser-reset

Error message in JS console:

Screenshot 2023-12-19 at 10 40 35 AM

Error Text:

shinylive.js:64 Uncaught (in promise) Error: Unexpected response type: "null", expected "list".
    at y4 (shinylive.js:64:97)
    at async B2 (shinylive.js:43:4848)
    at async r1.makeRequest (shinylive.js:377:781)
georgestagg commented 8 months ago

Thanks, sorry to ask but could you run a couple more tests?

Do things work better in Incognito/Private Browsing mode? Or in other browsers? I have a hunch this is related to the Service Worker, but I'm not 100% sure yet.

If it works in incognito mode, please can you please visit chrome://serviceworker-internals/ in a new tab (not incognito), then search for "Scope: https://shinylive.io/r/`. For any matching entries, please click the "Stop" button, then "Unregister". Finally, perform another hard reload of the shinylive page (not incognito).

Sorry to have to ask, but doing this will definitely rule out any caching/SW issues.

coatless commented 8 months ago

@georgestagg If I switch over to Safari, I can get it to render. However, I have to do a hard refresh.

shinylive-safari-with-reset-mid-load

With Firefox, everything works as normal:

shinylive-firefox-first-run

Putting Chrome into Incognito didn't change anything:

shinylive-demo-from-private-browser

jeroen commented 8 months ago

backtrace from firefox:

Screenshot 2023-12-20 at 12 08 09 Screenshot 2023-12-20 at 12 09 42
georgestagg commented 8 months ago

I've invalidated the AWS cache for R packages hosted at repo.r-wasm.org. I might need to automate that step in the future.

@coatless, please can you try refreshing the page again to see if it has helped? You may need to perform two hard refreshes so that both the network and Service Worker cache obtain an updated version of the files.

jeroen commented 8 months ago

For me the problem was only solved in Chrome after manually purging the history+cache in the browser. Simply forcing a refresh of the page did not seem to fully wipe the cache.

coatless commented 8 months ago

Works great now with the cache invalidated over at AWS in Chrome! Also, the need to do a hard refresh in safari also disappear. Thanks 👍