Node Polyfills
dApp-kit has been built on top of Connex, which will require crypto, buffer, http, https and some other node polyfills, check example app configuration files if you are stuck.
1) Require is not a function
export default defineConfig({
...
build: {
commonjsOptions: {
transformMixedEsModules: true,
},
}
...
})2) [crypto, http, https, stream, etc...] module not found
import { nodePolyfills } from 'vite-plugin-node-polyfills';
export default defineConfig({
plugins: [nodePolyfills()],
...
})3) Can't find variable [Buffer, process, global]
Last updated
Was this helpful?