Closed chtmorris closed 1 year ago
going to rebuilt some core functionality of this package soon but for it to build properly as is you must resolve your buffer on build in your vite config
did some rework on the package try version 0.3.0! need to install peer dependencies viem
and @wagmi/core
hmmm. I have just tried v 0.3.0, but I'm getting the same result that buffer is not defined. viem
and @wagmi/core
are both installed.
Any other ideas?
it will using polyfills or setting your buffer in vite config
@chtmorris
import { sveltekit } from '@sveltejs/kit/vite';
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],
resolve: {
alias: {
stream: 'stream-browserify',
util: 'util/',
buffer: 'buffer/'
}
},
};
export default config;
this is myvite.config
file for a random project maybe this may be of help you might want to try NodePolyfills
if this doesn't help
So I'm an idiot and was trying to do this in a Svelte app and not a SvelteKit app. Now using SvelteKit and not having this buffer issue!
Thanks for your help!
Great package - I really want to get this working!
I started a new project and added added this package. Builds fine, but the site fails to load. In the browser console I get the error:
Uncaught ReferenceError: buffer is not defined at main.js:9:2