pig icon indicating copy to clipboard operation
pig copied to clipboard

Allow two pig.json files to reference each other without Maximum call stack size exceeded error

Open KylePalko opened this issue 8 years ago • 3 comments

I ran into this issue when I had an API Server that I wanted to spin up with my App Server (and vice versa)

/app/pig.json

{
  "include": {
    "../api/pig.json": "api"
  }
}

/api/pig.json

{
  "include": {
    "../app/pig.json": "app"
  }
}

This will cause the error below

RangeError: Maximum call stack size exceeded
    at fromJsonFile (/usr/local/lib/node_modules/docker-pig/lib/config.js:25:59)
    at Object.module.exports.fromFile (/usr/local/lib/node_modules/docker-pig/lib/config.js:11:16)
    at /usr/local/lib/node_modules/docker-pig/lib/config.js:49:38
    at Function.forOwn (/usr/local/lib/node_modules/docker-pig/node_modules/lodash/dist/lodash.js:2106:15)
    at resolveIncludes (/usr/local/lib/node_modules/docker-pig/lib/config.js:48:7)
    at Object.module.exports.fromFile (/usr/local/lib/node_modules/docker-pig/lib/config.js:18:12)
    at /usr/local/lib/node_modules/docker-pig/lib/config.js:49:38

KylePalko avatar May 21 '16 23:05 KylePalko

Btw, thanks for this. It's exactly what I needed! I may try to get involved in the project once I understand the context. I wouldn't mind making this change if you'd like.

KylePalko avatar May 21 '16 23:05 KylePalko

Hi!

Sorry, I'm not maintaining pig actively at the moment. You should try using docker-compose or similar tool instead. pig has last been tested with docker 1.4.0 (or was it 1.5.0).

mnylen avatar May 23 '16 06:05 mnylen

Ah, okay. Thanks. Was there a specific reason you stopped supporting it? It has some added features that Docker Compose doesn't yet have.

KylePalko avatar Jun 07 '16 22:06 KylePalko