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

unidici doesn't play nice with webpack #2015

Closed
uriva opened this issue Mar 18, 2023 · 1 comment
Closed

unidici doesn't play nice with webpack #2015

uriva opened this issue Mar 18, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@uriva
Copy link

uriva commented Mar 18, 2023

I am writing a package in deno, and compiling it into npm.

Somehow unidici gets in the compiled target.

I then use webpack because I want to use this package in react setup.

webpack refuses to process unidici because of two dependencies: util/types and stream/web

I haven't found a polyfill for them.

Any idea what can be done?

this is my webpack config

const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");

const path = require("path");

module.exports = {
  mode: "production",
  entry: "./src/index.js",
  output: {
    filename: "main.js",
    path: path.resolve(__dirname, "dist"),
  },
  plugins: [new NodePolyfillPlugin()],
  resolve: {
    fallback: {
      perf_hooks: false,
      async_hooks: false,
      dns: false,
      tls: false,
      child_process: false,
      fs: false,
      net: require.resolve("net-websocket-polyfill"),
      diagnostics_channel: require.resolve("diagnostics_channel"),
      worker_threads: require.resolve("bthreads"),
    },
  },
};
@uriva uriva added the enhancement New feature or request label Mar 18, 2023
@KhafraDev
Copy link
Member

this is a duplicate of #1992

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

No branches or pull requests

2 participants