keymetrics / pmx

(DEPRECATED) use @pm2/io instead (drop-in replacement) https://github.com/keymetrics/pm2-io-apm
265 stars 35 forks source link

Add webpack support #97

Open vcarel opened 6 years ago

vcarel commented 6 years ago

We use Webpack to package our node app, but we can't make pmx work because it looks for some conf in the package.json.

We get the below exception on require(pmx)

1|myapp| TypeError: Path must be a string. Received undefined
1|myapp|     at assertPath (path.js:28:11)
1|myapp|     at Object.dirname (path.js:1352:5)
1|myapp|     at findPackageJson (/[...]myapp/build/ssr/webpack:/node_modules/pmx/lib/configuration.js:24:36)
1|myapp|     at Object.module.exports.Options.init (/[...]myapp/build/ssr/webpack:/node_modules/pmx/lib/configuration.js:43:26)
1|myapp|     at Object.module.exports.module.exports (/[...]myapp/build/ssr/webpack:/node_modules/pmx/lib/pmx.js:31:31)

We used Webpack mostly for convenience, so we might fallback to a "classic" deployment with node_modules and so on. However I was wondering if it would be an easy fix on your side to not look for package.json (besides it's not a documented feature... is it?)

Thanks :-)

dominik1001 commented 6 years ago

I am having a similar issue using babel-watch.


    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.relative (path.js:1262:5)
    at ChildProcess.app.on ([...]/node_modules/babel-watch/babel-watch.js:282:37)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at emit (internal/child_process.js:772:12)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
error An unexpected error occurred: "Command failed.
edith4cim commented 6 years ago

Same issue here, unfortunately not using Webpack isn't an option for us. Did you find any workaround to be able to use PMX with Webpack?

vcarel commented 6 years ago

@edith4cim We removed webpack... :-(

mrs-eload commented 6 years ago

Same issue here, we had to remove PMX.