Issue
Some versions of RStudio throw an error in the Viewer pane of my javascript widget, and some don't.
Code
I've created a htmlwidget for my googleway
package that plots a Google Map.
To reproduce this issue (if indeed it is an issue on your system) you can simply run this code
devtools::install_github("SymbolixAU/googleway")
library(googleway)
google_map(key = '') ## you don't need a key to see the error
But if you want to view a map, you'll need a Google Maps API key
Description
The issue I'm having is that on some versions of Rstudio the map shows in the Viewer pane, and in others it doesn't.
When I "inspect" the Viewer (right-click > inspect > console), I get the error
SyntaxError: Unexpected identifier 'i'. Expected either 'in' or 'of' in enumeration syntax.
Which links to a for
loop inside the javascript (see screenshot and the source code)
This morning I upgraded Rstudio on the system that caused the error, but it's still giving the error.
The following two screenshots show two different Macs (both running OS Sierra) with Rstudio, with examples of
- Rstudio v1.0.143 - not working
- Rstudio v1.0.136 - working
Why does some versions of RStudio throw the error, and some don't?