vercel / vercel/ncc

do you even realize what a nightmare using this is

Open
#892 5 comments 18 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

lmao

go with esm modules and use import statements and ncc generates esm code with eval('require') so node throws require is not defined in ES module scope.

drop esm modules and use require statements and ncc compiles cjs code (even with --target es2015 specified) and node throws Error: Cannot find module for each required local module because when you use require it doesn't bundle local modules(???).

i just wasted hours of my life trying to figure out what i'm doing wrong only to realize what i'm doing wrong is trying to use ncc in the first place, apparently. i can't believe github recommends this officially in their documentation.

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 both cases described with ncc: an ESM entry using import statements and a CommonJS entry using require with --target es2015. Compare the generated output and Node errors, especially eval('require') and missing local modules. Done means both module styles produce runnable bundled output, with a focused regression test or documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.