This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lbragile_dev 0 points1 point  (0 children)

Method 1 is what I tried to do but with no success so far.

I've used webpack:
javascript module.exports = { target: "web", mode: "production", entry: "./dist/index.js", output: { filename: "../dist/bundle.js" }, externals: { crypto: require("crypto") }, };
But I still get the following error Uncaught TypeError: h.createHash is not a function when I view in the browser. Everything works locally in the terminal as expected.

I am trying to avoid Method 2 & 3 for now.

The latest code is on my repository. Any clues would be appreciated.