Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on Node.js specific modules #160

Open
lostpebble opened this issue Apr 15, 2022 · 1 comment
Open

Remove dependency on Node.js specific modules #160

lostpebble opened this issue Apr 15, 2022 · 1 comment

Comments

@lostpebble
Copy link
Contributor

Hi,

I'd like to use this module inside a non-Node.js context, and unfortunately the dependency on "util" is not allowing me to:

X [ERROR] Could not resolve "util"

    ../node_modules/elastic-builder/lib/core/util.js:9:23:
      9 │ var _require = require('util'),
        │                        ~~~~~~
        ╵                        "./util"

  The package "util" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "--platform=node" to do that, which will remove this error.    

X [ERROR] Could not resolve "util"

    ../node_modules/elastic-builder/lib/queries/helper.js:3:23:
      3 │ var _require = require('util'),

Specifically, I'd like to use this from Cloudflare Workers- which is basically the same context as a Service Worker. Since this project is about simply creating JSON to put into a POST request to an endpoint- it seems like using Node.js specific modules should not be necessary for any core functionality, and I guess they were used for some specific utility functionality which could be patched, either directly or with another module which doesn't rely on any specific execution context.

If I look into it, and create a PR with the compatible changes- would this be alright?

@sudo-suhas
Copy link
Owner

Yes, would be happy to accept the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants