KNOWLEDGE BASE

Error "ReferenceError: Can't find variable: $ file" When Connecting via Web Data Connector


Published: 07 Oct 2015
Last Modified Date: 11 May 2016

Issue

When connecting via the Web Data Connector in Tableau Desktop, the following error might occur:
 
An error occurred while communcating with the data source.
The web data connector has reported an unrecoverable error and cannot proceed. If the connector has reported details of the error, they are displayed in the pane below.

ReferenceError: Can't find variable $ file:
<web data link>

Environment

  • Tableau Desktop 9.1.0
  • Web Data Connector

Cause

Work with your IT team to ensure that the computer security settings do not block access to jQuery. 

Additional Information

In the Tableau data connector examples, there are two required libraries listed at the top of the HTML file: 

<script src="https://online.tableau.com/javascripts/api/tableauwdc-1.1.0.js" type="text/javascript"></script> 
    and
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> 

The first <script> element is a reference to the Tableau Web Data Connector JavaScript library (tableauwdc-1.1.0.js). This JavaScript library contains code that enables communication between the connector and Tableau Desktop and must appear in the file before you make any calls that involve the object. 

The second <script> element loads the jQuery library (jquery.min.js) from the googleapis.com site. In order for the coding to be simplified and communicable, this library must also not be blocked. 

The jQuery library and the Tableau JavaScript library can be downloaded into a local directory. These libraries are located in the JS directory of the SDK (Software Development Kit). If these libraries are downloaded to a local directory, the 'src=' path will need to be adjusted. 
Did this article resolve the issue?