# Web3Auth works mobile browsers when i connecting nextjs app router but not connecting nextjs page based router throw invalid url

**URL:** <https://builder.metamask.io/t/web3auth-works-mobile-browsers-when-i-connecting-nextjs-app-router-but-not-connecting-nextjs-page-based-router-throw-invalid-url/961>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [September 4, 2025, 4:06pm UTC](https://builder.metamask.io/t/web3auth-works-mobile-browsers-when-i-connecting-nextjs-app-router-but-not-connecting-nextjs-page-based-router-throw-invalid-url/961 "2025-09-04T16:06:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abishekcseksrct](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@abishekcseksrct](https://builder.metamask.io/u/abishekcseksrct)\
**Post date:** [September 4, 2025, 4:06pm UTC](https://builder.metamask.io/t/web3auth-works-mobile-browsers-when-i-connecting-nextjs-app-router-but-not-connecting-nextjs-page-based-router-throw-invalid-url/961/1 "2025-09-04T16:06:29Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **abishekcseksrct** on 9/4/2025.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

[![WhatsApp Image 2025-09-04 at 17.10.42](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/127b6ebebc7157081d830e98b4e9ef7440b60de0.jpeg)
WhatsApp Image 2025-09-04 at 17.10.42720×1600 85.8 KB
](https://web3auth.io/community/uploads/default/original/2X/8/8b4732967cb9c438bd732193f6db837023994bd6.jpeg "WhatsApp Image 2025-09-04 at 17.10.42")
  

[![Screenshot 2025-09-04 at 9.35.28 PM](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/a2ecf0b0e14bb9001e89c8225db5d798564061ee.png)
Screenshot 2025-09-04 at 9.35.28 PM2880×1800 499 KB
](https://web3auth.io/community/uploads/default/original/2X/e/e2664f76b0c15860bec9692b73055535662d78ba.png "Screenshot 2025-09-04 at 9.35.28 PM")
  

[![Screenshot 2025-09-04 at 9.35.17 PM](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/a6e839be8546e9e36134714792cb89695939de89.png)
Screenshot 2025-09-04 at 9.35.17 PM2880×1800 486 KB
](https://web3auth.io/community/uploads/default/original/2X/2/2dc8a53e8d658bc08d6220e96e70b99307e86898.png "Screenshot 2025-09-04 at 9.35.17 PM")
  

[![Screenshot 2025-09-04 at 9.34.47 PM](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/0a265f6d0025ab2aef55d0b03c0b543382c10684.jpeg)
Screenshot 2025-09-04 at 9.34.47 PM1920×1200 105 KB
](https://web3auth.io/community/uploads/default/original/2X/e/e4f6099fe0cd243fbb65fe2dfa4b0dd2c28e2391.jpeg "Screenshot 2025-09-04 at 9.34.47 PM")

---

<div class="post-metadata">

**Author:** ![w3abot](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@w3abot](https://builder.metamask.io/u/w3abot)\
**Post date:** [September 4, 2025, 4:09pm UTC](https://builder.metamask.io/t/web3auth-works-mobile-browsers-when-i-connecting-nextjs-app-router-but-not-connecting-nextjs-page-based-router-throw-invalid-url/961/2 "2025-09-04T16:09:26Z")

</div>

Thanks for your detailed message and screenshots! Here’s a summary of your issue for the support team:

* * *

### Issue Summary

- **SDK Details:** Web3Auth Plug and Play (PnP) Web SDK
- **Framework:** Next.js
- **Routing:**
  - Works on mobile browsers with Next.js App Router
  - Fails to connect on Next.js Page-based Router (throws “invalid url” error)

- **Screenshots Provided:** Yes (error messages and UI)
- **Platform:** Web (Mobile browser focus)
- **Documentation Context:** You are following the official Web3Auth React SDK integration guide.

* * *

### Next Steps & Suggestions

To help resolve this, could you please provide:

1. **Web3Auth Initialization & Login Code Snippet**  
(Especially how you are initializing Web3Auth and handling login in your Next.js app.)

2. **Exact Error Message or Stack Trace**  
(If not visible in the screenshots, please paste the error message from the browser console.)

3. **SDK Version Number**  
(Check your `package.json` for the version of `@web3auth/modal`.)

4. **Next.js Version**  
(This can help us check for any known compatibility issues.)

* * *

### Initial Troubleshooting

- The “invalid url” error often happens if the redirect/callback URL is not set correctly or if the routing structure changes between App Router and Page Router.
- Please ensure that your Web3Auth dashboard project has the correct redirect URIs for both routing methods.
- Refer to the [Next.js Quick Start Guide](https://web3auth.io/docs/sdk/web/nextjs/quick-start) for best practices on using Web3Auth with different routing strategies.

* * *

Once you provide the code snippet and version details, the support team can offer more targeted help!

Thank you for your patience and for providing great context.

> Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

> Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. [Web3Auth Developer Office Hours](https://web3auth.io/community/t/web3auth-developer-office-hours/8777)
