holepunchto / pear

combined Peer-to-Peer (P2P) Runtime, Development & Deployment tool
https://pears.com/
Apache License 2.0
86 stars 9 forks source link

pear dev . fails silently on a failed import #89

Open ryanramage opened 4 months ago

ryanramage commented 4 months ago
~/apps/langchain-pear via  v18.14.1 took 25s
🐟 bare index.js
Uncaught ModuleResolveError: PACKAGE_PATH_NOT_EXPORTED: Package subpath '.' is not defined by "exports" in [object Object]
    at exports.packageExports (file:///bare.bundle/node_modules/bare-module-resolve/index.js:243:16)
    at exports.packageExports.next (<anonymous>)
    at exports.package (file:///bare.bundle/node_modules/bare-module-resolve/index.js:166:32)
    at exports.package.next (<anonymous>)
    at exports.module (file:///bare.bundle/node_modules/bare-module-resolve/index.js:97:26)
    at exports.module.next (<anonymous>)
    at [Symbol.iterator] (file:///bare.bundle/node_modules/bare-module-resolve/index.js:21:28)
    at Generator.next (<anonymous>)
    at Module.resolve (file:///bare.bundle/node_modules/bare-module/index.js:354:16)
    at Module._onimport (file:///bare.bundle/node_modules/bare-module/index.js:188:22)

vs

❯ pear dev .

~/apps/langchain-pear via  v18.14.1

tbh I was messing around with the import, but the one I had was

import Ollama from "@langchain/community"

ryanramage commented 4 months ago

So to be clear, that import is busted on my end. Just pointing out that pear dev should output the error like bare does

kasperisager commented 4 months ago

You also shouldn't be seeing [object Object] in the error message, that has been fixed here: https://github.com/holepunchto/bare-url/commit/f03147ccb6c87a02df079cb5d18c73b10de8f916