如何修复“Buffer is not defined”错误?
如果你在使用 @skip-go/widget 时看到Buffer is not defined 错误,通常是因为该组件依赖了浏览器环境中不可用的 Node.js 模块。要解决这个问题,你需要为这些模块添加 polyfill。
以下是常见环境可用的一些 polyfill 插件:
是否应该将组件放在一个固定尺寸的容器中?
建议使用一个具有固定尺寸的容器元素来包裹该组件。这样可以减少布局偏移,因为该组件使用了 shadow-dom(需要在客户端渲染)。我们建议高度为640px、宽度为 500px。
我可以将 Safe Multisig 钱包与 Skip Go 组件一起使用吗?
可以。Safe 钱包(广泛使用的多签钱包,地址为 https://app.safe.global)可以通过支持导入 Safe 钱包的钱包提供方与 Skip Go 组件配合使用:- Rabby Wallet:支持导入并使用 Safe 钱包
- WalletConnect:支持通过 WalletConnect 协议连接 Safe 钱包
为什么我会遇到 CORS 错误,或被 CORS 策略拦截?
如果你在使用 Skip Go 组件时看到 CORS 错误,说明你的域名需要加入白名单后才能访问 Skip Go 的 API 端点。 要解决这个问题,请前往我们的 Discord 服务器 提交支持工单,并申请将你的域名加入白名单。How do I fix the “Buffer is not defined” error?
If you see a ‘Buffer is not defined’ error when using @skip-go/widget, it’s likely because the widget depends on Node.js modules that aren’t available in the browser. To fix this, you’ll need to add polyfills for those modules. Here are some polyfill plugins for common environments:Should I put the widget inside a container with a fixed size?
It is recommended to wrap the widget with a container element that has a fixed size. This helps to prevent layout shifting as the widget uses the shadow-dom (which needs to be rendered client-side). We recommend a height of640px and a width of 500px.
Can I use Safe Multisig wallets with the Skip Go widget?
Yes! Safe wallets (the popular multisig wallet at https://app.safe.global) can be used with the Skip Go widget through wallet providers that support importing Safe wallets:- Rabby Wallet: Supports importing and using Safe wallets
- WalletConnect: Supports connecting Safe wallets through WalletConnect protocol