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