Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem : cannot open localhost:3030 inside WSL2 #2121

Open
ych817 opened this issue Mar 21, 2025 · 2 comments
Open

Problem : cannot open localhost:3030 inside WSL2 #2121

ych817 opened this issue Mar 21, 2025 · 2 comments

Comments

@ych817
Copy link

ych817 commented Mar 21, 2025

I am using windows 11 with WSL2 . I installed all code developing environment inside WSL2 .

  • version of WSL2 : 2.4.11.0
  • version of Ubuntu : 24.04.2 LTS
  • version of Node : 22.14.0
  • version of pnpm : 10.6.4
  • version of nvm : 0.40.1

I entered pnpm create slidev today ( 21 March 2025 , slidev v51.4.0 ) inside WSL and everything goes fine , except that http://localhost:3030 cannot show the slides .

The same thing also happened when I tweaking HUGO theme . The way I solve it is written in this article . Not sure if this can be used in our case .

Any suggestions ?

@ych817
Copy link
Author

ych817 commented Mar 21, 2025

Fixed . Here is a quite ugly solution :

  • First use ifconfig to checkout the inet :

    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.17.72.111  netmask 255.255.240.0  broadcast 172.17.79.255
            inet6 fe80::215:5dff:fef2:a904  prefixlen 64  scopeid 0x20<link>
            ether 00:15:5d:f2:a9:04  txqueuelen 1000  (Ethernet)
            RX packets 6725  bytes 25268609 (25.2 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 7299  bytes 137710315 (137.7 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 6587  bytes 49251803 (49.2 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 6587  bytes 49251803 (49.2 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
  • Notice that inet 172.17.72.111 , therefore use pnpm run dev --remote --bind 172.17.72.111 and you can run Slidev .

@ych817
Copy link
Author

ych817 commented Mar 22, 2025

However I cannot preview the slide inside vscode . Is there any way to modify the default address for slidev extension preview ?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant