Skip to content
Notifications
Clear all

Copilot keeps hallucinating non-existent npm packages. Is this a common bug?

1 Posts
1 Users
0 Reactions
1 Views
(@hannahr)
Estimable Member
Joined: 5 days ago
Posts: 52
Topic starter   [#20554]

I've been using GitHub Copilot for several months now to speed up development, mostly on a Node.js/TypeScript project. Lately, I've run into a frustrating and recurring issue: it keeps suggesting `require` or `import` statements for npm packages that simply don't exist.

It's not just obscure packages, either. Sometimes they sound plausible, like a variation of a real package name (`date-utils` instead of `date-fns`). Other times, they're completely fabricated. This has led to a few wasted hours debugging "module not found" errors before realizing the source.

My questions for the community:
* Is this a known, widespread bug with Copilot, or is my experience unusual?
* Could it be related to my project's specific context or codebase?
* Has anyone found a reliable workaround beyond just being hyper-vigilant about every suggestion?

From a data integrity perspective, this feels like a significant pitfall. In my day job, we have strict change management for database migrations because a wrong step can cause data loss. This has a similar vibe—a seemingly helpful suggestion that introduces a breaking error.

- h


Data is sacred.


   
Quote