Skip to content

Conversation

@nico-martin
Copy link
Collaborator

@nico-martin nico-martin commented Nov 30, 2025

I invested some time into #1236 and from what I see there are three ways how we could solve this:

  1. suppress console.error while creating InferenceSession

  2. while copying the wasm .mjs file we could overwrite the line that cases the console.error

  3. change the wasm library .mjs file.

  4. We (or the ONNX maintainers) would have to make changes directly in their library. This would certainly be the cleanest solution, but we would be dependent on third parties. 2. I would not recommend this, as it could disrupt the copying process if changes are made within the ONNX library.
    That's why solution one would be my favorite. It looks a bit messy or hacky, but honestly, I think it's the simplest solution.

@nico-martin nico-martin requested a review from xenova November 30, 2025 15:09
@nico-martin nico-martin changed the title suppress console.error while creating InferenceSession suppress console.error while creating InferenceSession (closes #1236) Nov 30, 2025
@nico-martin nico-martin changed the title suppress console.error while creating InferenceSession (closes #1236) suppress console.error while creating InferenceSession Nov 30, 2025
@xenova
Copy link
Collaborator

xenova commented Dec 1, 2025

Thanks for the PR! I recall that for V3, the inference session logging options would not work

[logSeverityLevel](https://onnxruntime.ai/docs/api/js/interfaces/InferenceSession.SessionOptions.html#logSeverityLevel)?: 0 | 2 | 1 | 3 | 4;
    [logVerbosityLevel](https://onnxruntime.ai/docs/api/js/interfaces/InferenceSession.SessionOptions.html#logVerbosityLevel)?: number;

but perhaps they work now? https://onnxruntime.ai/docs/api/js/interfaces/InferenceSession.SessionOptions.html


We can then set a global default logging behaviour, without needing to override global console methods.

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.

3 participants