ReferenceError
See original GitHub issueHello,
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:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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’.
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 ?