Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-wallet-esm-ssr-bundle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@reown/appkit-wallet": patch
---

Bundle @walletconnect/logger into the wallet package dist to fix SSR environments (SvelteKit, Next.js on Vercel) where Vite externalizes the dependency and Node.js resolves it as CJS, causing a "Named export not found" error at runtime.
3 changes: 2 additions & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"scripts": {
"build:clean": "rm -rf dist",
"build": "tsc --build",
"build": "tsc --build && vite build",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why build with vite herE? tsc is already building, this seems weird

"watch": "tsc --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
Expand All @@ -49,6 +49,7 @@
"devDependencies": {
"@vitest/coverage-v8": "2.1.9",
"jsdom": "24.1.0",
"vite": "5.4.20",
"vitest": "3.1.3"
},
"keywords": [
Expand Down
20 changes: 20 additions & 0 deletions packages/wallet/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'

export default defineConfig({
build: {
lib: {
entry: {
'exports/index': resolve(__dirname, 'exports/index.ts'),
'exports/utils': resolve(__dirname, 'exports/utils.ts')
},
formats: ['es'],
fileName: (_format, entryName) => `${entryName}.js`
},
outDir: 'dist/esm',
emptyOutDir: true,
rollupOptions: {
external: ['@reown/appkit-common', '@reown/appkit-polyfills', 'zod']
}
}
})
Loading