Failing to require modules
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 9.8k
- Forks
- 326
- PR merge metrics
- No merged PRs in 30d
Description
I were trying to deploy my nodejs server with vercel. But it is failing the error is very unclear to me. But it is something to do with the ncc module unable to require dynamically.
ncc: Version 0.18.5
21:19:05.930 | ncc: Compiling file index.js
21:19:11.839 | ncc: Module directory "/vercel/workpath0/node_modules/mongodb/lib/core/auth" attempted to require "aws4" but could not be resolved, assuming external.
21:19:18.498 | ncc: Module directory "/vercel/workpath0/node_modules/mongodb/lib/operations" attempted to require "mongodb-client-encryption" but could not be resolved, assuming external.
21:19:19.403 | ncc: Module directory "/vercel/workpath0/node_modules/ws/lib" attempted to require "utf-8-validate" but could not be resolved, assuming external.
21:19:19.403 | ncc: Module directory "/vercel/workpath0/node_modules/ws/lib" attempted to require "bufferutil" but could not be resolved, assuming external.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Vercel deployment using index.js with ncc 0.18.5, then inspect how dynamic requires are handled for mongodb, ws, and their optional modules. Done means the reported unresolved-module behavior is addressed and the deployment no longer fails; the issue names no repository file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100