Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo #403

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix typo #403

wants to merge 1 commit into from

Conversation

helpingstar
Copy link

output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.min.js',
},

The above code creates a bundle.min.js file in the dist directory.

2. use webpack to make bundle:
```sh
npm run build
```
this generates the bundle file `./dist/main.js`
3. run with
```sh
node dist/main.js
```

However, in README.md it says that it creates a bundle file ./dist/main.js and runs it through node dist/main.js.

This seems to be a typo, so I changed dist/main.js to ./dist/bundle.min.js.

hs@hs-OMEN:~/forks/onnxruntime-inference-examples/js/quick-start_onnxruntime-node-bundler$ npm install

added 151 packages, and audited 152 packages in 1s

23 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
hs@hs-OMEN:~/forks/onnxruntime-inference-examples/js/quick-start_onnxruntime-node-bundler$ npm run build

> [email protected] build
> webpack --config ./webpack.config.js --mode production

asset bundle.min.js 626 bytes [emitted] [minimized] (name: main)
asset model.onnx 120 bytes [emitted] [from: model.onnx] [copied]
./main.js 1.12 KiB [built] [code generated]
external "onnxruntime-node" 42 bytes [built] [code generated]
webpack 5.91.0 compiled successfully in 157 ms

Running node dist/main.js generates an error.

hs@hs-OMEN:~/forks/onnxruntime-inference-examples/js/quick-start_onnxruntime-node-bundler$ node dist/main.js
node:internal/modules/cjs/loader:1031
  throw err;
  ^

Error: Cannot find module '/home/hs/forks/onnxruntime-inference-examples/js/quick-start_onnxruntime-node-bundler/dist/main.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

node dist/bundle.min.js executes successfully.

hs@hs-OMEN:~/forks/onnxruntime-inference-examples/js/quick-start_onnxruntime-node-bundler$ node dist/bundle.min.js
data of result tensor 'c': 700,800,900,1580,1840,2100,2460,2880,3300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant