You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native项目启动后Metro Bundler无法在浏览器中打开的问题求助

Troubleshooting Metro Bundler Browser Access Issue for Expo Managed Workflow Project

Let’s walk through some practical fixes to get your Metro Bundler page loading in the browser—glad to hear your app already works on simulators and physical devices, that’s a solid start!

  • Double-check the Metro Bundler URL from your terminal
    When you run npm start, Expo will print a local URL (typically http://localhost:8081 or http://[your-local-IP]:8081) in the terminal output. Make sure you’re using this exact URL to open the browser page—sometimes the port shifts if 8081’s already in use, so don’t rely on a saved bookmark.

  • Restart Metro with cache cleared
    Stuck cache or a glitchy bundler process can block the browser interface. Try this:

    1. Press Ctrl + C (or Cmd + C on Mac) in your VS Code terminal to stop the running bundler.
    2. Run npx expo start --clear to wipe cached assets and start fresh.
    3. Once the bundler spins up again, try opening the URL right away.
  • Test with a clean browser environment

    • Open the Metro URL in an incognito/private window—this skips cached data and disables most extensions. If it loads here, your regular browser’s cache or an extension (like an ad blocker or privacy tool) is blocking the page.
    • Clear your browser’s cache and cookies for local development sites, then retry accessing the URL.
  • Check network and firewall settings

    • If you’re using a VPN, turn it off temporarily. VPNs can interfere with local network connections that Metro relies on.
    • Verify your computer’s firewall isn’t blocking the port Metro uses (usually 8081). Try accessing http://localhost:8081 directly—if you get a "connection refused" error, add an exception for the Metro bundler process or the specific port in your firewall settings.
  • Update Expo CLI to the latest version
    Outdated CLI versions can cause odd compatibility issues. Run npm install -g expo-cli to update, then restart your project with npm start.

  • Trigger the browser manually from the terminal
    When the bundler is running, press the w key in your terminal—this should tell Metro to open its interface in your default browser automatically. If that doesn’t work, copy the exact URL from the terminal and paste it directly into your browser’s address bar.

If none of these steps resolve the issue, share any error messages from your browser’s console (right-click > Inspect > Console tab) or extra terminal output—those details will help pinpoint the problem further!

内容的提问来源于stack exchange,提问作者Tasadduq Hussain

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 22:57:31