Describe the bug
Using ui-react-2.0.0-beta.1 & Next.js returns the error window.localStorage is undefined. localStorage is required for TonConnectUI Error.
To Reproduce
Steps to reproduce the behavior:
Create new next.js project npx create-next-app@latest nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"
cd nextjs-blog
Add "@tonconnect/ui-react": "^2.0.0-beta.1" to depencencies in packages.json
Install depencencies with yarn install
Add import { TonConnectUIProvider, TonConnectButton } from "@tonconnect/ui-react"; in pages/index.js
Run yarn dev
See error
Expected behavior
No errors should be returned from yarn dev or yarn build
Hi guys!
Describe the bug Using
ui-react-2.0.0-beta.1
&Next.js
returns the errorwindow.localStorage is undefined. localStorage is required for TonConnectUI Error
.To Reproduce Steps to reproduce the behavior:
npx create-next-app@latest nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"
cd nextjs-blog
"@tonconnect/ui-react": "^2.0.0-beta.1"
to depencencies inpackages.json
yarn install
import { TonConnectUIProvider, TonConnectButton } from "@tonconnect/ui-react";
inpages/index.js
yarn dev
Expected behavior No errors should be returned from
yarn dev
oryarn build
Screenshots
Additional context I think
checkLocalStorageExists
can be removed. https://github.com/ton-connect/sdk/blob/9e999123d68a7725bd890a181850063fd28f429c/packages/ui/src/app/utils/web-api.ts#L96-L102