Unity WebGL in React -> expected expression, got '<'

Hi everyone!

I wanted to put my WebGL game into a React project:

import ‘./App.css’;
import React from “react”;
import Unity, { UnityContext } from “react-unity-webgl”;

const unityContext = new UnityContext({

dataUrl: “build/Build/0.0.0.data”,
frameworkUrl: “build/Build/0.0.0.framework.js”,
codeUrl: “build/Build/0.0.0.wasm”,
loaderUrl: “build/Build/0.0.0.loader.js”,
});

function App() {
return (

); }

export default App;

The paths are good I am sure about it.
When I run the project I get the following:

Can someone help me?

1 Like

put the build folder under Public instead of src and update the paths accordingly. Look at the closed issues in their git repo.

1 Like