vercel / vercel/ncc

"TypeError: mod.require is not a function" error when trying use @sentry/tracing

Open
#617 2 comments 4 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

Got an error TypeError: mod.require is not a function when trying to start compiled express server than use @sentry/tracing package.

image

Error occurs when performing this function call from @sentry/utils package:

image

Any ideas how this can be fixed? Thanks in advance!

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

Start with the compiled Express server entry point and reproduce the failure while loading @sentry/tracing. Inspect the @sentry/utils call shown in the issue and compare how the compiled module handles mod.require; done means the server starts without the TypeError when @sentry/tracing is used.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, nodejs
Domain
backend, build-system
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.