In the last two blogs, I shared how AI failed to solve a few issues in programming and the value of self-search; today, I am going to share the opposite. The main goal is to show how you can learn from AI and use it as effectively as possible.
This all started when I was using trigger.dev and got the following error:
Node.js 21 detected without native WebSocket support. Suggested solution: For Node.js < 22, install "ws" package and provide it via the transport option: import ws from "ws" new RealtimeClient(url, { transport: ws }) using trigger.dev
The error clearly asks me to either install the ws package or update Node.js. But since I did not have a full experience with trigger.dev I could not figure out how to do that.
My approach to debugging is based on methods:
With this error, I went with AI first, asking ChatGPT about it; then I tried Googling it (which used to work before the AI age), but I could not find any data.
With ChatGPT, I gave it two extra points to help it get the right answer; I shared that I am using trigger.dev, added the web resources, and asked for a solution based on my tech stack.
By giving ChatGPT context and a web search, it was able to find the config page on trigger.dev and get the results I wanted.
With this experience and the ones I had before, the most important thing when using AI was the context and knowledge I had to provide. The in-depth knowledge can help the user and AI to find the optimal solution, yet going blindly might lead you to a black hole without knowing how to return.