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

Community site session details

Session Id : zgtR/cA4bEV5WnGM6Smbwh
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Component fails in mobile apps because of missing Webpack publicPath

Like (0) ShareShare
ReportReport
Posted on 24 Jan 2023 12:16:57 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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete