web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PCF Harness (NPM Start...
Power Apps
Answered

PCF Harness (NPM Start), how do i target another control to start?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Might be a silly question, but i'm working on two controls at the moment.

 

How do i set the target of the "npm start" harness to load the second control?

 

:\PCF_Controls\_PCF\NumberButtonSelector>npm start

> pcf-project@1.0.0 start C:\PCF_Controls\_PCF
> pcf-scripts start

Kicking off PCF start process...
.....
Starting control harness...
Mapping / to "C:\PCF_Controls\_PCF\node_modules\pcf-start"
Serving "C:\PCF_Controls\_PCF\out\controls\Control1" at http://127.0.0.1:8181 ***I WANT IT TO LOAD Control2, not 1****
Ready for changes
I have the same question (0)
  • Verified answer
    alchin Profile Picture
    Microsoft Employee on at

    Hi Andrew,

     

    By default NPM start is designed to initiate the control defined in the current PCF project into the harness.  If you have two separate control projects (PCF project), then you will need to CD into the root of the second pcf project and run npm start.  All of the npm commands are project centric commands (build, clean, rebuild, start) and are designed to be applied to the current project only.

     

    Under the hood, npm start calls the pcf-start script.  That script is designed to accept a --codePath argument which enables a user to point the harness to any directory that contains compiled control sources (ControlManifest.xml and bundle.js).

     

    For example, if I had my control code compiled into a folder called c:\out\controls\mycontrol, I could run:

    npx pcf-start --codePath c:\out\controls\mycontrol

     

    to launch the control from any output folder.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
     That script is designed to accept a --codePath argument which enables a user to point the harness to any directory that contains compiled control sources (ControlManifest.xml and bundle.js).

    ^ that's perfect.  Thank you alchin.

  • leiff Profile Picture
    3 on at

    I was having the same issue, and I wanted to be able to use the 'watch' option and without needing to build to 'out' to quickly see my changes.

    I turns out, that the test harness simply runs the first control - sorted alphabetically on the containing folders.

    So you can simply prefix the foldername containing the control that you want to execute with an underscore, and then run 'npm run watch'

     

    /Leif

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard