Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Answered

Virtual PCF control errors out on Power Pages

(0) ShareShare
ReportReport
Posted on by 23
Hello all! I'm working on a project where I'm adding PCF controls to a Power Pages portal. I've encountered an issue where virtual controls return an error on the portal, here's a screenshot of the error in the console:
 
 
However, when I put the same control together in a standard component, it renders just fine. It seems like the issue is that building the virtual component doesn't package React in with the component in a way that the portal can use. The virtual control works perfectly fine in a model-driven app.
 
I was curious if anyone has any insight on how to solve this issue.
 
Thanks!
  • vitalii_hladkyi Profile Picture
    vitalii_hladkyi 10 on at
    Virtual PCF control errors out on Power Pages
    have the same issue, don't know how to fix this((
  • Verified answer
    SaiRT14 Profile Picture
    SaiRT14 1,931 on at
    Virtual PCF control errors out on Power Pages
    Hi 
     
    Power Pages portals, operate in a different environment where dependencies like React and ReactDOM may not be readily available or are sandboxed.
    If your PCF control doesn’t bundle its dependencies properly, the portal cannot resolve them, resulting in errors.
     
    Open your PCF control’s pcfconfig.json file and make sure the isolationMode is set to none. This ensures the dependencies are bundled.
    {
      "namespace": "MyNamespace",
      "controlName": "MyControl",
      "isolationMode": "none",
      "properties": {...}
    }

    Run the following commands to build the control with bundled dependencies
    npm install --save react react-dom
    npm install --save-dev webpack-bundle-analyzer
     
    include Webpack configuration
    externals: {
      react: 'React',
      'react-dom': 'ReactDOM'
    }
     
    pls try and let me know. thanks

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard