I found that this was the problem. I used the gltf-webpack-loader npm package to import the path into my React component and then used that path in my loader. It requires a bit of tinkering with the webpack configuration file.
import gltfPath from '../path/to/file.gltf'
Then use it like this:
this.loader.load(gltfPath,
(gltf) => {
this.scene.add(gltf.scene);
});