Skip to content

npm run dev error System.Net.HttpListenerException #134

@DropperDEV

Description

@DropperDEV

Describe the bug

Steps to Reproduce

Open a Power Apps project using Vite and the Power Platform CLI

Run the following command:

npm run dev

Wait for Vite to start on http://localhost:3000

Observe that pac code run throws a System.Net.HttpListenerException

Power Apps fails to load the local app

Expected behavior

Power Apps should load the local app successfully — as it used to before this issue began.

Actual behavior

The app fails to load, and pac code run terminates with an unrecoverable error (System.Net.HttpListenerException).

Screenshots or Error Messages

> appname@0.0.0 dev
> concurrently "vite" "pac code run"

[0]   VITE v7.1.9  ready in 321 ms
[0]   ➜  Local:   http://localhost:3000/
[0]   ➜  Network: http://<local-ip>:3000/
[1] Connected as <user@domain.com>
[1] power.config.json available at http://localhost:8080/
[1] You can test the app locally using:
      https://apps.powerapps.com/play/e/<environment-id>/a/local?_localAppUrl=http://localhost:3000/&_localConnectionUrl=http://localhost:8080/
[1] The app encountered an unrecoverable error and needs to close.
    Exception Type: System.Net.HttpListenerException
    Session ID: d181f245-fe0d-407d-b733-eb6f9b6e4184
[1] Diagnostic logs can be found at:
    C:\Users\<username>\AppData\Local\Microsoft\PowerAppsCLI\Microsoft.PowerApps.CLI.1.49.4\tools\logs\pac-log.txt
[1] pac code run exited with code 0

Image

Environment information

  • Node.js: v22.14.0

  • npm: 10.9.2

  • Power Platform CLI: 1.49.4 Windows MSI

  • Build tool: Vite

Additional context

  • The issue started recently; the same setup used to work without issues.

  • This is not app-specific — it happens with any Power Apps project I try to run locally using npm run dev.

  • Verified that ports 3000 and 8080 are not in use by other processes.

  • Tried the following commands with no success:

  • pac install latest

  • npm rebuild

  • npm cache clean --force

  • Restarted VS Code and the machine multiple times.

  • The issue persists consistently on every run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions