Skip to main content

Notifications

Community site session details

Community site session details

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

PCF - possible webpack issue with Express npm module

(0) ShareShare
ReportReport
Posted on by

Hi,

When using the Express npm module within a PCF control I'm getting the following warning and then a lot of errors:

WARNING in ./node_modules/express/lib/view.js 74:13-25
Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js

 

The advice I've found online is to use webpack-node-externals to exclude Express from being bundled.  If I look at webpackConfig.js in my PCF control then node modules are already excluded.  If I use webpack-node-externals anyway then this resolves the build errors but then my control doesn't load.

 

I'd be really grateful for any advice.

 

Thanks

 

Paul

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: PCF - possible webpack issue with Express npm module

    Unfortunately, that's only going to solve your problem temporarily. An Initialized PCF attaches to npm install and writes over the webpack config a bit indelicately. So, the next time you (or someone who grabs your code) run npm install, it will overwrite your change and you'll need to edit config again.

     

    (not the answer you were hoping for, I am sure)

     

    @HemantG is this a known issue?

  • Community Power Platform Member Profile Picture
    on at
    Re: PCF - possible webpack issue with Express npm module

    Adding the following code to the webpack config seems to have fixed it:

    externals: [{ 'express': { commonjs: 'express' } }]

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

🌸 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…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 81 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 53 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard