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

Notifications

Announcements

Community site session details

Community site session details

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

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

(0) ShareShare
ReportReport
Posted on by

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard