How do I host my React js application with ONNX support?

I’m a beginner in web development, and I wanted to better understand how to host a React.js application with ONNX support. I used ‘create-react-app’ to build my React.js application, which is designed to recognize campus buildings. My application works as expected on localhost. However, when I upload my React build to hosting websites like Netlify and Firebase Hosting, it results in an error.

Here is the code on how I’m loading the model:

  async function loadModel() {
    const session = await InferenceSession.create("./model.onnx", {
      executionProviders: ["webgl"],
    })
    setModelSession(session)
    console.log("Model loaded")
  }

  useEffect(() => {
    loadModel()
  }, [])
  return (
    <div className="App">
      <DisplayPage predictImage={predictImage} theme={theme} />
    </div>
  )
}

Error when loading the website:

Uncaught (in promise) TypeError: e._nodes[t] is undefined

After conducting some research, I’ve learned that placing my ONNX model in the public folder isn’t the correct approach to storing the model. Therefore, I tried moving the model to an ‘assets’ folder within the ‘src’ folder. However, it’s resulting in the same issue. I’m assuming my problem is derived from my model not loading properly because my ‘App.js’ file can’t find it. I would appreciate any help that points me in the right direction, especially materials regarding this aspect of web development. Thanks!