I've been trying to add onnxjs support in [VoTT](https://github.com/microsoft/Vo…TT/issues/794), but I've been hitting some issues. I have a model that I was able to successfully run in node.js, but when I try to run it on the frontend, I get
```javascript
TypeError: cannot resolve operator 'Shape' with opsets: ai.onnx v9
```
I tried [converting the model](https://github.com/onnx/onnx/blob/master/docs/PythonAPIOverview.md#converting-version-of-an-onnx-model-within-default-domain-aionnx) to use a lower opset, but I faced similar errors with the converted models.
So I thought that I'd be clever and try a workaround and run the model on the backend using onnxjs-node, sending the results back to the frontend using IPC.
After adding a little code into src/electron/main.ts
```javascript
import { Tensor, InferenceSession } from "onnxjs-node";
const inferenceSession = new InferenceSession();
```
and updating my webpack config, I'm seeing a couple of new errors.
```
σ csaroff:~/fiddle/VoTT$ node_modules/.bin/webpack-cli --config config/webpack.dev.js
...
WARNING in ./node_modules/onnxjs-node/bin/napi-v3 sync ^\.\/.*\.node$
Module not found: Error: Can't resolve 'node-loader' in '/Users/csaroff/fiddle/VoTT'
@ ./node_modules/onnxjs-node/bin/napi-v3 sync ^\.\/.*\.node$
@ ./node_modules/onnxjs-node/lib/binding.js
@ ./node_modules/onnxjs-node/lib/inference-session-override.js
@ ./node_modules/onnxjs-node/lib/index.js
@ ./src/electron/main.ts
ERROR in ./node_modules/onnxjs/lib/wasm-binding.js
Module not found: Error: Can't resolve 'worker-loader' in '/Users/csaroff/fiddle/VoTT/node_modules/onnxjs/lib'
@ ./node_modules/onnxjs/lib/wasm-binding.js 101:29-96
@ ./node_modules/onnxjs/lib/backends/backend-wasm.js
@ ./node_modules/onnxjs/lib/api/onnx-impl.js
@ ./node_modules/onnxjs/lib/api/index.js
@ ./node_modules/onnxjs-node/lib/index.js
@ ./src/electron/main.ts
```
So then I ran `npm install --save-dev node-loader worker-loader` and tried rerunning webpack.
```
σ csaroff:~/fiddle/VoTT$node_modules/.bin/webpack-cli --config config/webpack.dev.js
...
ERROR in ./node_modules/onnxjs/lib/wasm-binding.js
Module not found: Error: Can't resolve './worker/worker-main' in '/Users/csaroff/fiddle/VoTT/node_modules/onnxjs/lib'
@ ./node_modules/onnxjs/lib/wasm-binding.js 101:29-96
@ ./node_modules/onnxjs/lib/backends/backend-wasm.js
@ ./node_modules/onnxjs/lib/api/onnx-impl.js
@ ./node_modules/onnxjs/lib/api/index.js
@ ./node_modules/onnxjs-node/lib/index.js
@ ./src/electron/main.ts
```
And this is where I'm stuck. I see that you chose not to include lib/worker in your [tsconfig file](https://github.com/microsoft/onnxjs/blob/master/tsconfig.json#L3), but I couldn't figure out why. So I tried rebuilding the project, removing the ` "exclude": ["lib/worker"],` line from the tsconfig.json, but that just gives me a whole mess of typescript errors.
```
σ csaroff:~/fiddle/onnxjs$npm run build
> onnxjs@0.1.7 build /Users/csaroff/fiddle/onnxjs
> tsc && node tools/build --build-wasm --build-bundle
node_modules/typescript/lib/lib.dom.d.ts:25:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: EventListenerOrEventListenerObject, ImportExportKind, TableKind, BlobPart, HeadersInit, BodyInit, RequestInfo, DOMHighResTimeStamp, CanvasImageSource, OffscreenRenderingContext, MessageEventSource, ImageBitmapSource, TimerHandler, PerformanceEntryList, VibratePattern, AlgorithmIdentifier, HashAlgorithmIdentifier, BigInteger, NamedCurve, GLenum, GLboolean, GLbitfield, GLint, GLsizei, GLintptr, GLsizeiptr, GLuint, GLfloat, GLclampf, TexImageSource, Float32List, Int32List, BufferSource, DOMTimeStamp, FormDataEntryValue, IDBValidKey, Transferable, BinaryType, CanvasDirection, CanvasFillRule, CanvasLineCap, CanvasLineJoin, CanvasTextAlign, CanvasTextBaseline, ClientTypes, EndingType, IDBCursorDirection, IDBRequestReadyState, IDBTransactionMode, ImageSmoothingQuality, KeyFormat, KeyType, KeyUsage, NotificationDirection, NotificationPermission, OffscreenRenderingContextId, PermissionName, PermissionState, PushEncryptionKeyName, PushPermissionState, ReferrerPolicy, RequestCache, RequestCredentials, RequestDestination, RequestMode, RequestRedirect, ResponseType, ServiceWorkerState, ServiceWorkerUpdateViaCache, VisibilityState, WebGLPowerPreference, WorkerType, XMLHttpRequestResponseType
25 interface Account {
~~~~~~~~~
node_modules/typescript/lib/lib.webworker.d.ts:25:1
25 interface AddEventListenerOptions extends EventListenerOptions {
~~~~~~~~~
Conflicts are in this file.
...
```
I'm pretty much out of ideas. I checked in a minimally reproducible example on [this branch](https://github.com/csaroff/VoTT/tree/onnxjs-backend-example). Here's a [diff of the changes](https://github.com/csaroff/VoTT/commit/a90769d2009c154ff47c412d63a305b7e5943c83). Any help/insight here would be great!