Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Component fails in mobile apps because of missing Webpack publicPath

(0) ShareShare
ReportReport
Posted on by

Since pcf-scripts switched to Webpack 5 in version 1.10.4. there is a problem if a component is used in a Dynamics 365 mobile app - like the Dynamics 365 Field Service mobile app. The user only sees a "Error loading control". The detail error dialog shows further: "Error occured during initialization of control: {Name} Message: Could not find/invoke {Name} constructor." This is because the component fails to register itself, due to an earlier Webpack exception:

 

"Automatic publicPath is not supported in this browser"

 

It only happens in mobile apps, because Webpack can't resolve any public path in the WebView environment.

There is a fix. The "webpackConfig.js" can be modified so that there is a default empty public path.

output: {
 // This library value control what global variable the output control is placed in.
 library: constants.TEMP_NAMESPACE,
 pathinfo: true,
 filename: constants.BUNDLE_NAME,
 path: controlOutputDir,
 publicPath: '' // fixes "Automatic publicPath is not supported in this browser" exception
},

With this set the component does work again in mobile apps. It also works if we use the "pcfAllowCustomWebpack" feature and set the publicPath in our custom webpack config.

module.exports = {
 output: {
 publicPath: ""
 }
}

But I think this should be released in the default "webpackConfig.js" of the pcf-scripts package.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 94 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 72 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard