Please enable Crypto
https://github.com/remorses/esbuild-plugins/blob/d9f6601a24dc4e0470046eda8c772e6523c52b96/node-modules-polyfill/src/polyfills.ts#L142
Is there any alternative to this? Currently stuck on it as well.
@CojocaruDr try using esbuild-plugin-polyfill-node
@CojocaruDr try using
esbuild-plugin-polyfill-node
Bad docs. Assuming this is the usage, it is not helping.
import { polyfillNode } from 'esbuild-plugin-polyfill-node'
...
build: {
sourcemap: true,
bundle: true,
entryPoints: ['./src/main.tsx'],
outfile: 'dist/bundle.js',
plugins: [
polyfillNode({
polyfills: {
crypto: true,
},
}),
],
Is that the right usage?
@CojocaruDr try using
esbuild-plugin-polyfill-nodeBad docs. Assuming this is the usage, it is not helping.
import { polyfillNode } from 'esbuild-plugin-polyfill-node' ... build: { sourcemap: true, bundle: true, entryPoints: ['./src/main.tsx'], outfile: 'dist/bundle.js', plugins: [ polyfillNode({ polyfills: { crypto: true, }, }), ],Is that the right usage?
this works for me for Cloudflare workers
try setting:
build: {
...
platform: 'browser',
conditions: ['worker', 'browser'],
...
}
edit:
build worked, but still encounter different error when running miniflare