Skip to content

Embedding model fails to load in Electron - transformers.node.mjs ERR_MODULE_NOT_FOUND (v0.19.0+) #78

@wwth8819

Description

@wwth8819

What happened

After upgrading from v0.17.0 to v0.19.0, the local embedding model (Xenova/all-MiniLM-L6-v2) fails to load on every 15-minute timer tick.

Error log

[magic-context] embedding model failed to load: Cannot find module 'C:\Users\13096.cache\opencode\packages@cortexkit\opencode-magic-context@latest\node_modules@huggingface\transformers\dist\transformers.node.mjs' imported from C:\Users\13096.cache\opencode\packages@cortexkit\opencode-magic-context@latest\node_modules@cortexkit\opencode-magic-context\dist\index.js
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '...transformers.node.mjs'

What I expected

Embedding model loads normally as it did in v0.17.0.

Repro steps

  1. Upgrade MC plugin from v0.17.0 to v0.19.0 via doctor --force + restart OpenCode Desktop
  2. Check magic-context.log — embedding fails every 15 minutes on timer tick
  3. The file transformers.node.mjs exists on disk at the specified path, but Node.js ESM resolver cannot find it

Environment

  • OpenCode Desktop v1.14.33 (Electron 34.3.0, Node ABI 145)
  • Windows 11
  • MC v0.19.0 (plugin cache)
  • @huggingface/transformers v4.2.0
  • Embedding config: local (Xenova/all-MiniLM-L6-v2 bundled)

Notes

  • Doctor check passes 14/14 (config-level check only)
  • All other MC features work fine (transform, historian, dreamer, ctx_reduce)
  • The file exists on disk — this appears to be an ESM module resolution issue specific to Electron environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions