Class extends value undefined is not a constructor or null

I’m having trouble with the docker-compose. I know it works locally on my m1 mac and an intel mac.

An obvious difference is that I use docker compose instead of docker-compose, which implies I’m using Docker Compose v2 locally. However, I don’t think that’s relevant.

Here are the errors I get trying to bring up my dev environment:

Step 7/12 : RUN npm install --ignore-scripts
—> Running in 92999d4599c3
TypeError: Class extends value undefined is not a constructor or null
at Object. (/usr/local/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/agent.js:114:44)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/usr/local/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/index.js:5:33)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (/usr/local/lib/node_modules/npm/node_modules/make-fetch-happen/lib/agent.js:161:25)
at Module._compile (internal/modules/cjs/loader.js:1085:14)

Hi @acrefoot!

That’s strange indeed. But when I search for that particular error message online, it seems to be caused by a circular dependency problem: https://stackoverflow.com/a/44727578/3461173

Could this possibly be a bug in your project’s TypeScript code?

1 Like

Hey Jan,

Thanks for the reply!

I just tested docker-compose build --no-cache next on a M1 and an Intel Mac. They run without errors. I assume this is coming from a difference in the docker-in-docker system on gitpod vs Docker Desktop on a Mac. I’m just not sure how to debug it from here. Are there common gotchas to try looking for?

Hi @acrefoot ,

it’s always easier to follow and reproduce if you have a link to play around with.
Could you share one to the repo you’re experiencing this?

Okay, I put together a greatly simplified repo here: GitHub - acrefoot/gitpod-test

Works locally, but not on gitpod.

It took a couple hours. Sorry for the delay.