Repository: next.js
Issue: Failed to parse source map: TypeError: Cannot read properties of undefined (reading 'bold') for deno
Labels: bug,linear: next

### Link to the code that reproduces this issue

https://github.com/howdoicomputer/issue-reproduction

### To Reproduce

1. Create a new project and add

```
import OpenAI from 'openai';

const client = new OpenAI();
```

To the top of `app/page.tsx`

2. `deno run dev`

3. Watch app crash when the index page is loaded

### Current vs. Expected behavior

You can create an openai client without the entire thing falling apart.

### Provide environment information

```bash
Platform: darwin
  Arch: arm64
  Version: 24.1.0
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 20.11.1
  npm: 10.8.2
  Yarn: N/A


❯ deno --version
deno 2.0.6 (stable, release, aarch64-apple-darwin)
v8 12.9.202.13-rusty
typescript 5.6.2
```

```
❯ cat package.json
{
  "name": "polarstomps",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "openai": "^4.71.1",
    "react": "19.0.0-rc-66855b96-20241106",
    "react-dom": "19.0.0-rc-66855b96-20241106",
    "next": "^15.0.3",
    "sharp": "^0.33.5",
    "zod": "^3.23.8",
    "chalk": "^5.3.0"
  },
  "devDependencies": {
    "typescript": "^5",
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "postcss": "^8",
    "tailwindcss": "^3.4.1",
    "eslint": "^8",
    "eslint-config-next": "15.0.3"
  },
  "overrides": {
    "chalk": "^5.3.0"
  }
}
```
  pnpm: N/A
Relevant Packages:
  next: 15.0.3 // Latest available version is detected (15.0.3).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: N/A
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Not sure

### Which stage(s) are affected? (Select all that apply)

next dev (local)

### Additional context

I've been having this error pop up quite a bit that has been hard for me to track down.

Full stack trace:

```
Failed to parse source map: TypeError: Cannot read properties of undefined (reading 'bold')
    at getDefs (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/compiled/babel/bundle.js:1848:5496)
    at highlight (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/compiled/babel/bundle.js:1848:6631)
    at codeFrameColumns (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/compiled/babel/bundle.js:1:77498)
    at getOriginalCodeFrame (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/client/components/react-dev-overlay/server/shared.js:70:44)
    at createOriginalStackFrame (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/client/components/react-dev-overlay/server/middleware.js:146:61)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/client/components/react-dev-overlay/server/middleware.js:286:52)
    at async HotReloaderWebpack.run (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/server/dev/hot-reloader-webpack.js:317:13)
    at async handleRequest (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/server/lib/router-server.js:214:43)
    at async requestHandlerImpl (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/server/lib/router-server.js:384:13)
    at async ServerImpl.requestListener (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/server/lib/start-server.js:142:13)
Failed to parse source map: TypeError: Cannot read properties of undefined (reading 'bold')
    at getDefs (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/compiled/babel/bundle.js:1848:5496)
    at highlight (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/compiled/babel/bundle.js:1848:6631)
    at codeFrameColumns (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/compiled/babel/bundle.js:1:77498)
    at getOriginalCodeFrame (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/client/components/react-dev-overlay/server/shared.js:70:44)
    at createOriginalStackFrame (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/client/components/react-dev-overlay/server/middleware.js:146:61)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/client/components/react-dev-overlay/server/middleware.js:286:52)
    at async HotReloaderWebpack.run (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/server/dev/hot-reloader-webpack.js:317:13)
    at async handleRequest (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/server/lib/router-server.js:214:43)
    at async requestHandlerImpl (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/server/lib/router-server.js:384:13)
    at async ServerImpl.requestListener (/Users/tylerhampton/workspace/polarstomps/node_modules/.deno/next@15.0.3/node_modules/next/dist/server/lib/start-server.js:142:13)
```

I initially had this problem when I was trying to create an API route that wrapped some openai calls. Whenever I would instantiate a new openai client I would get a stacktrace that led with `Failed to parse source map: TypeError: Cannot read properties of undefined (reading 'bold')`. I ended up moving that functionality to a dedicated FastAPI backend but now I'm getting that error again and I'm not sure what the origin is now.

The only Google reference I have for that error points to chalk. Really confusing and hard to debug.