Error related to Node.js (package not found on filesystem)
However, running the convex code is giving the following error:
It's giving errors for other imports such as
node:fs/promises as well. HNSWLib, a vectorstore that langchain provides a wrapper for, imports these node utilities, and from what my aggressive googling has informed me the issue has something to do with the environment in which Convex is running. Most of the googling shows Cloudflare or Sveltekit-related issues (ie https://stackoverflow.com/questions/73178856/sveltekit-packages-not-being-able-to-access-node-functions, https://github.com/evanw/esbuild/issues/1996, etc). I'm not really sure if Convex's run environment doesn't support node or isn't up-to-date past v18 (which introduced prefixed imports), or if even is related to Convex at all. What I want: for those who have used external functions from other files, how do you recommend accomplishing something similar to what I am trying to do? Is it ok that I use functions from other files within the convex directory? Does Convex run node, and if so, what would be causing this issue? I've read that it might be related to polyfills, but not sure. Any and all help appreciated!!
2022-07-30T19:05:14.
