# RStudio Viewer shows blank plots. The browser can show them though

**URL:** <https://community.plotly.com/t/rstudio-viewer-shows-blank-plots-the-browser-can-show-them-though/3359>\
**Category:** Plotly R\
**Created:** [February 14, 2017, 10:38am UTC](https://community.plotly.com/t/rstudio-viewer-shows-blank-plots-the-browser-can-show-them-though/3359 "2017-02-14T10:38:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![b\_a](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@b\_a](https://community.plotly.com/u/b_a)\
**Post date:** [February 14, 2017, 10:38am UTC](https://community.plotly.com/t/rstudio-viewer-shows-blank-plots-the-browser-can-show-them-though/3359/1 "2017-02-14T10:38:07Z")

</div>

#Problem#  
For some reason my RStudio (v1.0.136) stopped showing plotly (v4.5.6) graphs in the Viewer.  
When I right-click and `Inspect element` I can see the following error:

```
Failed to load resource: A server with the specified hostname could not be found.  
http://localhost:14985/session/viewhtmle0e7ad97b99/index.html?viewer_pane=1

```

Opening that link in Chrome shows the plot, so the file is there.

When I run these commands in RStudio:

```
viewer <- getOption("viewer")
viewer("http://localhost:14985/session/viewhtmle0e7ad97b99/index.html?viewer_pane=1")

```

I get the same error. But, if I replace `localhost` with `127.0.0.1`:

```
viewer <- getOption("viewer")
viewer("http://127.0.0.1:14985/session/viewhtmle0e7ad97b99/index.html?viewer_pane=1")

```

The plot shows as expected in the Viewer window.

#Attempts#  
I have restored my `/etc/hosts` file (content, ownership and permissions). This did not result in any other behaviour.  
I have checked the output of `lsof | grep localhost`:

```
RStudio 57564 user 12u IPv4 0x746dc97144b1de71 0t0 TCP localhost:53434->localhost:27978 (ESTABLISHED)
RStudio 57564 user 13u IPv4 0x746dc97144b1de71 0t0 TCP localhost:53434->localhost:27978 (ESTABLISHED)
rsession 57575 user 5u IPv4 0x746dc97144868c81 0t0 TCP localhost:27978 (LISTEN)
rsession 57575 user 6u IPv4 0x746dc9714568c769 0t0 TCP localhost:27978->localhost:53434 (ESTABLISHED)
rsession 57575 user 19u IPv4 0x746dc97145a1c061 0t0 TCP localhost:14985 (LISTEN)

```

And to me it seems that the `rsession` is listening to the correct port on localhost.

I have also turned off the Mac OS firewall, this did not have any effect.

I have turned off Little Snitch (a firewall for outgoing connection) as well, this did not have any effect.

## Update 2017-02-15:

I have found that this behaviour is dependent on the network I am connected to.

- Work Ethernet - all OK
- Home wifi - Issue as described above
- Android wifi hotspot - all OK
- Wifi adapter switched off - new error in the `Inspect element` window: Failed to load resource: The Internet connection appears to be offline``

What network setting can affect plotly’s interaction with RStudio’s Viewer?

---

<div class="post-metadata">

**Author:** ![bcd](https://avatars.discourse-cdn.com/v4/letter/b/ec9cab/32.png) [@bcd](https://community.plotly.com/u/bcd)\
**Post date:** [February 14, 2017, 1:16pm UTC](https://community.plotly.com/t/rstudio-viewer-shows-blank-plots-the-browser-can-show-them-though/3359/2 "2017-02-14T13:16:19Z")

</div>

Hey @b_a,

Perhaps this discussion will be of interest [https://github.com/ropensci/plotly/issues/717](https://github.com/ropensci/plotly/issues/717)

---

<div class="post-metadata">

**Author:** ![b\_a](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@b\_a](https://community.plotly.com/u/b_a)\
**Post date:** [February 15, 2017, 8:10am UTC](https://community.plotly.com/t/rstudio-viewer-shows-blank-plots-the-browser-can-show-them-though/3359/3 "2017-02-15T08:10:44Z")

</div>

Thanks @bcd,

However, that seems to be another issue not related to localhost/127.0.0.1 but to the use of ArrayBuffer.  
Any other suggestions are still welcome.

---

<div class="post-metadata">

**Author:** ![b\_a](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@b\_a](https://community.plotly.com/u/b_a)\
**Post date:** [February 15, 2017, 10:47pm UTC](https://community.plotly.com/t/rstudio-viewer-shows-blank-plots-the-browser-can-show-them-though/3359/4 "2017-02-15T22:47:29Z")

</div>

I find that it depends on my network configuration (see update). Anyone know how this might be possible?
