ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
764 stars 113 forks source link

Bundling throws 'Uncaught Error: Cannot find module...' #304

Open Chaz-Commscope opened 6 months ago

Chaz-Commscope commented 6 months ago

Using LigerShark.WebOptimizer v3.0.405 with EPiServer.CMS 12.28.0 and the following config:

"webOptimizer": { "enableTagHelperBundling": true } In a browser we get the error: Uncaught Error: Cannot find module

image

What can I add or where can I look to get an idea of what the problem is?

When it's set to False - it works and doesn't bundle the files and we see no errors - only happens when it's bundled.

catester commented 3 months ago

I got a similar error "__webpack_require__ is not defined" after updating to the latest package (simple ASP.NET core web site). Guess it tries to process dependencies in already minified site template js file and produces an incorrect bundle? Rolled back to version 3.0.384 which works. Had to clear the cache folder and force refresh the browser.