Open logancyang opened 8 months ago
console log your variable: var __dirname = RUNNING_LOCALLY ? import_path.default.dirname(import_path.default.dirname(import_url.default.fileURLToPath(import_meta.url))) : "./";
this __dirname not return string or URL instance, look like it return undefined
Plugin failure: copilot TypeError: The "path" argument must be of type string or an instance of URL. Received undefined
@hiepxanh the stacktrace I posted shows Object.fileURLToPath
got undefined as argument, so import_meta.url
is undefined. A couple of lines above there's import_meta = {}
so there's ofc no url. Not sure what to make of this.
do you use ESM?
do you use ESM?
Just confirmed with the Obsidian community, ESM is not an option right now, all Obsidian plugin must be CJS. I wonder what I can do here 🫠 Hopefully the good people here can find a workaround
@logancyang you cannot do anything, I have to refactor my code to ESM and decided to give up and use API haha
System Info
transformers.js version: 2.14.0 MacOS Sonoma 14.2.1 NodeJS: v19.8.1 React: v18.2.0
Environment/Platform
Description
Hi I'm trying to follow this instruction at LangchainJS to use the huggingface transformers embeddings in my Obsidian plugin copilot, but am seeing an error regarding this package, not sure how to fix, any help is greatly appreciated! Let me know if anything else is needed to debug this.
Reproduction
Issue
Additional info
Obsidian uses esbuild and my config is: