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

Multiple nodejs_compat packages missing (crypto, path, etc) #756

Closed
hansottowirtz opened this issue Jan 17, 2024 · 4 comments
Closed

Multiple nodejs_compat packages missing (crypto, path, etc) #756

hansottowirtz opened this issue Jan 17, 2024 · 4 comments

Comments

@hansottowirtz
Copy link
Contributor

When using nodejs_compat in Miniflare 2, only the following modules are available: assert, async_hooks, buffer, events, util

These ones are missing: crypto, diagnostics_channel, path, process, stream (and stream/promises, stream/consumers), string_decoder.

I'm willing to add these, but as this package is almost deprecated, would you be open for a PR? As we're using globals we can't migrate to Miniflare 3 yet.

@mrbbot
Copy link
Contributor

mrbbot commented Jan 17, 2024

Hey! 👋 Yep, we'd be open to a PR, but as you point out this package is pretty-much deprecated. What are you using globals for? It's possible Miniflare 3 provides a mechanism that would help with your use case. 🙂

@hansottowirtz
Copy link
Contributor Author

I'm creating a Knex client in Node that connects to our local database and then passing it to Miniflare:

    globals: {
      _local_createGlobalKnexClient: createKnexClient,
      _local_getPostgresClient: () => postgresNode(dbConnectionString),
    }

However I think this would be fixed once Hyperdrive support (with local databases support) is added to Miniflare 3.

@mrbbot
Copy link
Contributor

mrbbot commented Jan 17, 2024

Cool! Miniflare 3 does support Hyperdrive now, looks like this wasn't added to the API documentation though.

const mf = new Miniflare({
  hyperdrives: {
    DB: "postgresql://user:password@localhost:5432/database"
  }
});

@mrbbot
Copy link
Contributor

mrbbot commented Jan 23, 2024

Hey again! 👋 I'm going to close this issue since it looks like you've been able to switch to Miniflare 3, and we're getting very close to deprecating Miniflare 2 now that cloudflare/workers-sdk#4795 is up. 👍

@mrbbot mrbbot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants