Vite: process is not defined
Install the Node polyfill plugin:
vite.config.ts
Next.js: Node-only module errors
For webpack builds, disable browser resolution for Node-only modules and externalize optional server packages:next.config.ts
Next.js: ESM package resolution
The published next builds contain extensionless ESM imports. Without transpilation, Node’s SSR loader can reject an internal import withERR_MODULE_NOT_FOUND, commonly for a path ending in /knownIds.
Add the Widget’s shared packages and every installed @layerswap/wallet-* package to transpilePackages:
next.config.ts
@layerswap/wallets too if you use the lazy descriptor package. The package names use the published wallet-imtbl-* and wallet-module-* forms. Re-check the module packages against the 2.0.0 release.