question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught ReferenceError: FULLTILT is not defined

See original GitHub issue

The README.md mentions that FullTilt is bundled with gyronorm.js but when running the page (using the default values) I’m getting the error:

"Uncaught ReferenceError: FULLTILT is not defined"

Sorry if I’m missing something obvious. Thanks.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:10
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
ada-ada-ada-artcommented, Apr 4, 2019

I managed to get it working in Vue.js (which uses Webpack to load modules, and should be similar to React or Angular). It is by no means a pretty solution, but it might get others to where they need to go.

Step 1

Download v0.5.3 of Fulltilt here, since it seems to be the latest version with a license, which allows commercial use.

Step 2

Remove line 17-22 and 1469-1473 from fulltilt.js, i.e.

(function ( window ) {

// Only initialize the FULLTILT API if it is not already attached to the DOM
if ( window.FULLTILT !== undefined && window.FULLTILT !== null ) {
    return;
}

and

////// Attach FULLTILT to root DOM element //////

window.FULLTILT = FULLTILT;

})( window );

Step 3

Attach this to the end of the file: export default FULLTILT;. Then save the file somewhere locally in your project. For me, that was assets/fulltilt.js.

Step 4

Change line 112 and 116 in lib/gyronorm.js to: var deviceOrientationPromise = new this.FULLTILT.getDeviceOrientation({ 'type': _orientationBase }).then(function(controller) {

and

var deviceMotionPromise = new this.FULLTILT.getDeviceMotion().then(function(controller) {

Step 5

Import FULLTILT and Gyronorm to your project, e.g. like this:

import FULLTILT from '../assets/fulltilt.js';
import GyroNorm from 'gyronorm';

Step 6

After constructing the Gyronorm object and before initializing it, add Fulltilt to the object like this:

var gn = new GyroNorm();
gn.FULLTILT = FULLTILT;

That’s it. You should be able to work with Gyronorm now.

I’m sure there is a smarter way, e.g. by passing Fulltilt to the constructor or, as @dorukeker suggests, to remove the Fulltilt dependency altogether.

3reactions
angularsencommented, Sep 10, 2017

I run into the same with webpack following this: https://github.com/dorukeker/gyronorm.js/pull/30

import GyroNorm from 'gyronorm';

    const gn = new GyroNorm();
    gn.init()
      .then(() => {
        gn.start(data => {
        });
      })
      .catch(e => {
      });

Will use the minified distributable meanwhile:

// import GyroNorm from 'gyronorm';
var GyroNorm = require('../libs/gyronorm.complete.js');
Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Uncaught ReferenceError: FULLTILT is not defined -
The README.md mentions that FullTilt is bundled with gyronorm.js but when running the page (using the default values) I'm getting the error: "Uncaught...
Read more >
Uncaught ReferenceError: $ is not defined? - Stack Overflow
The most common reason behind the error "Uncaught ReferenceError: $ is not defined" is executing the jQuery code before the jQuery library file...
Read more >
Got message "Uncaught ReferenceError: $ is not defined"
That error occurs when we try to run CC code on our machine without including a script element to load the jQuery core...
Read more >
JavaScript常见的六中错误- pxmt - 博客园
Uncaught ReferenceError 错误的解决方案: 在js开发中,很多人遇到类似问题,都找不到解决方法。Uncaught ReferenceError: $ is not defined,在这里给 ...
Read more >
Uncaught referenceerror is not defined | Edureka Community
Why and how does the written code give a result as an Uncaught ReferenceError: $ is not defined ... "text/javascript" src="
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found