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.

Hello,

I’m trying to setup a project using react unity. I have created a build using unity and copied the files in my public folder. Using this code in App.js:

import React, { Component } from 'react';
import './App.css';
import Unity from 'react-unity-webgl';

class App extends Component {
  render() {
    return (
        <Unity
          src='public/buildunity/build2.json'
          loader='public/buildunity/UnityLoader.js' />
    )
  }
}
export default App;


I'm getting the error in the browser:  "(in promise) ReferenceError: UnityLoader is not defined"
Any Idea what might be wrong?
Maybe I made a mistake. The react project was created with "create-react-app". 
Thanks a lot!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MichaelRazumcommented, Mar 5, 2018

Hi Jeffrey,

thanks a lot for your answer. I will try it out the next days! Is it correct that in that case the project should be build first to run it? Right now I’m starting it with ‘react-scripts start’.

0reactions
Mounajidevcommented, Jan 10, 2022

Comment Remember, contributions to this repository should follow its contributing guidelines and code of conduct.

I copied the files inside the main project/build folders, just to testing. even do i deleted them now,and it still not working. And i used ‘npm create-react-app’ for creating the project, i am quite new with react, do i missing something ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError - JavaScript - MDN Web Docs
The ReferenceError object represents an error when a variable that doesn't exist (or hasn't yet been initialized) in the current scope is ...
Read more >
How to Resolve an Uncaught Reference Error in Javascript
The Javascript ReferenceError occurs when referencing a variable that does not exist or has not yet been initialized in the current scope.
Read more >
JavaScript ReferenceError: A Complete Guide | Career Karma
In JavaScript a reference error is mainly thrown when a code is attempting to reference a variable that does not exist, but there...
Read more >
Uncaught ReferenceError: $ is not defined
Uncaught ReferenceError: $ is not defined: This usually indicates that jQuery is not loaded and JavaScript does not recognize $. Even with $(document).ready ......
Read more >
What causes ReferenceError on live web sites? - CatchJS
ReferenceErrors happen when JavaScript code references variables that have never been declared. A common reason for this error is that one piece of...
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