Skip to content

esbuild.context is not a function #69

@hammer-ai

Description

@hammer-ai

Hi there, I got this error, which it says I should open an issue for:

~/repo/my-project/apps/web pnpm dev                                          ✹main 

> [email protected] dev /Users/my-name/repo/my-project/apps/web
> next dev -p 3001

   ▲ Next.js 15.2.3
   - Local:        http://localhost:3001
   - Network:      http://192.168.68.54:3001
   - Experiments (use with caution):
     ✓ externalDir

 ✓ Starting...
This error shouldn't have happened. Please consider opening a GitHub issue with the stack trace below here:
https://github.com/timlrx/contentlayer2/issues

An unchecked error was produced.

TypeError: esbuild.context is not a function
    at T.tryCatchPromise.UnknownEsbuildError.error.error (file:///Users/my-name/repo/my-project/node_modules/@contentlayer2/core/dist/getConfig/esbuild.js:64:79)
    at file:///Users/my-name/repo/my-project/node_modules/@effect-ts/system/_mjs/Effect/promise.mjs:13:5
    at file:///Users/my-name/repo/my-project/node_modules/@effect-ts/system/_mjs/Effect/effectAsync.mjs:30:5
    at FiberContext.evaluateNow (file:///Users/my-name/repo/my-project/node_modules/@effect-ts/system/_mjs/Fiber/context.mjs:892:35)
    at file:///Users/my-name/repo/my-project/node_modules/@effect-ts/system/_mjs/Fiber/context.mjs:504:33
    at file:///Users/my-name/repo/my-project/node_modules/@effect-ts/system/_mjs/Support/Scheduler/index.mjs:11:22

Fiber: #5 (started at: 2025-03-26T02:15:12.496Z) was supposed to continue to: <empty trace>

Fiber: #5 (started at: 2025-03-26T02:15:12.496Z) Execution trace: <empty trace>

Fiber: #5 (started at: 2025-03-26T02:15:12.496Z) was spawned by:

Fiber: #0 (started at: 2025-03-26T02:15:12.489Z) was supposed to continue to: <empty trace>

Fiber: #0 (started at: 2025-03-26T02:15:12.489Z) Execution trace: <empty trace>

Fiber: #0 (started at: 2025-03-26T02:15:12.489Z) was spawned by: <empty trace>

OS: darwin 23.4.0 (arch: arm64)
Process: /Users/my-name/.nvm/versions/node/v20.19.0/bin/node /Users/my-name/repo/my-project/apps/web/node_modules/next/dist/server/lib/start-server.js
Node version: v20.19.0
Contentlayer version: 0.5.4

My package.json has:

"dependencies": {
  "contentlayer2": "^0.5.4",
  "next": "15.2.3",
  "next-contentlayer2": "^0.5.4",
...

"devDependencies": {
  "typescript": "^5.5.4"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions