Skip to content

Conversation

@thorwebdev
Copy link

@thorwebdev thorwebdev commented Jul 15, 2024

See demo

Local configuration:

"openctx.providers": {
    "file:///<path>/openctx/provider/postgres/dist/index.js": {
      "DB_URL": "postgresql://postgres:postgres@127.0.0.1:54322/postgres"
    }
  },

@thorwebdev
Copy link
Author

Trying to test this locally, but getting an error: failed to call provider: Error: Cannot find module './client.js'
image

The client.js file is bundled in the /dist folder though. Any ideas what might be wrong here?
image

@thorwebdev
Copy link
Author

Ahh, I guess I need to point to the bundle.js file locally actually. Any idea where I can find the console.log statements though?

@tinvaan
Copy link
Contributor

tinvaan commented Jul 15, 2024

Ahh, I guess I need to point to the bundle.js file locally actually. Any idea where I can find the console.log statements though?

That's right, you need to point to your local bundle.js file.
console.log statements should be visible in your editor's(VSCode) developer console[cmd + Shift + P > Toggle Developer Tools]. It's usually flooded with a ton of info, so it may be easier if you use console.error instead and filter for "Errors only".

Screenshot 2024-07-15 at 5 55 07 PM

@thorwebdev
Copy link
Author

@tinvaan thaaank you 🫶 working like a charm now 🙌
image


## Debug

To see console log statements of your provider, open the vscode developer tools: [`cmd + Shift + P`] > "Toggle Developer Tools". No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably okay, but just wondering if there's a better way to show debug info, maybe in Cody's output channel. @keegancsmith do you know if it's possible?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not currently, but that would be a good improvement for us to add.

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