Issue when calling loadLayersModel in browser

I get the following error when I call loadLayersModel in vanilla javascript.
“Uncaught (in promise) TypeError: tf.loadLayersModel is not a function”

Here is my code:

import DeviceDetector from “”;
import * as tf from “”;
import React, { useEffect } from “”;
import ReactDOM from “”;

// Usage: testSupport({client?: string, os?: string}[])
// Client and os are regular expressions.
// See: for
// legal values for client and os

(async () => {
const model1 = await tf.loadLayersLModel(’);


Has anyone else encountered this error?

You would likely need to load the TFJS library first before anything else to use it. It seems you load the detector first and then the library it needs to run?