Problem in training images

Based on this document, I want to train the images in the browser, but I encounter many errors.
As described in this document, can Image Training be done in the browser or must it be done using NodeJs and through api?

Hello @fawela3670,

Yes, the image trainer can be utilized on the browser. Can you please verify that you have imported the web build of the trainer using this code:

import { train } from "@zappar/imagetraining/web";

If you have already done so, kindly share any error messages you may have encountered.

Thank you!

Hi @Deim ,
Sorry for late reply.
I already added it, but after importing the train method as you said, we have this error:

ERROR Failed to compile with 1 errors

This dependency was not found:
* @zappar/imagetraining/web in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/index.vue ?vue&type=script&lang=js&
To install it, you can run: npm install --save @zappar/imagetraining/web

I think it is because ‘@zappar/imagetraining/web’ is replaced by ‘@zappar/imagetraining/lib/web’ (due to the package directory structure).

But after I use ‘@zappar/imagetraining/lib/web’, I get this error:
ERROR in ./node_modules/@zappar/imagetraining/lib/web/index.js

Module parse failed: Unexpected token (4:60)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See
| import * as api from "./api";
| export * from "./api";
> api.___setWorker(new Worker(new URL("./image.worker", import.meta.url), { type: "module" }));

I tried different ways but this error still exists. Is it possible to send a link to a github repository that I can compare?