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 / Component fails in mob...
Power Apps
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.

I have the same question (0)

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard