vercel / vercel/ncc

Failing to require modules

Open
#609 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.