Distributed-Compute-Labs / dcp-client

This is the official client library for DCP, the Distributed Compute Protocol.
MIT License
4 stars 1 forks source link

Deprecation warning on Node 14 #10

Closed bryan-hoang closed 2 years ago

bryan-hoang commented 3 years ago

When trying to run a dcp-client application on Node.js v14.x, DeprecationWarning: Module.createRequireFromPath() is deprecated. Use Module.createRequire() instead. always appears (Deprecated since v12.2.0), as seen in the stack trace below:

$ node app.js
(node:3770) [DEP0130] DeprecationWarning: Module.createRequireFromPath() is deprecated. Use Module.createRequire() instead.
    at Object.job$$createModuleBundle [as createModuleBundle] (webpack:///./src/dcp-client/job/node-modules.js?:68:44)
    at Job._pack (webpack:///./src/dcp-client/job/index.js?:699:100)
    at Job._publishLocalModules (webpack:///./src/dcp-client/job/index.js?:712:55)
    at Job.[Job.deploy] (webpack:///./src/dcp-client/job/index.js?:1111:42)
    at Job.exec (webpack:///./src/dcp-client/job/index.js?:817:31)
    at async main (/home/foo/bar/app.js:39:17)

It doesn't affect the running of the application it seems, but would it be possible to not have to make me work around suppressing this warning manually, given that it isn't due to my application's code?

Steps to reproduce:

  1. Initialize an empty npm project with npm init
  2. Install dcp-client: npm i dcp-client
  3. Call an init method in the app:
      // In app.js
      require('dcp-client').initSync();
  4. Run the application: node app.js
  5. Receive the warning.

Package version: dcp-client@4.1.14 OS: Ubuntu 20.04.3 LTS Node version: v14.18.1

bryan-hoang commented 2 years ago

After revisiting the issue, it doesn't seem to occur after updating to dcp-client@4.2.10 for Node 14 or 16.