You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from prior 15.2 to 15.2 or later (including latest 16.x), I am getting ngDevMode is not defined error on app load. The error is terminating, app does not load.
I am using custom webpack plugin and esbuild-loader to build my app.
I reproduced the issue using standard Angular boilerplate project here:
To prove that it works fine in 15.1, I created a branch where the issue is fixed, and opened a PR to merge. Only package.json was changed, downgrading Angular to 15.1. PR triggers CI build, so you can confirm that the issue is indeed fixed:
Relevant bits of the custom webpack config, if commented out, the build works fine.
const { EsbuildPlugin } = require("esbuild-loader");
//...
if (options.optimization) {
// https://how-to.dev/how-to-speed-up-angular-cli-app-with-esbuild-loader
// remove 2 first minimizers, hoping they are the TerserPlugin
config.optimization.minimizer.shift();
config.optimization.minimizer.shift();
config.optimization.minimizer.unshift(
new EsbuildPlugin(),
);
}
Expected behavior
If Angular CLI can minify it without build or startup errors, so should the EsbuildPlugin.
Problem
After upgrading from prior 15.2 to 15.2 or later (including latest 16.x), I am getting
ngDevMode is not defined
error on app load. The error is terminating, app does not load.I am using custom webpack plugin and esbuild-loader to build my app.
I reproduced the issue using standard Angular boilerplate project here:
To prove that it works fine in 15.1, I created a branch where the issue is fixed, and opened a PR to merge. Only package.json was changed, downgrading Angular to 15.1. PR triggers CI build, so you can confirm that the issue is indeed fixed:
Angular team rejected my ticket as unsupported, apparently they don't support custom webpack at all.
Relevant bits of the custom webpack config, if commented out, the build works fine.
Expected behavior
If Angular CLI can minify it without build or startup errors, so should the EsbuildPlugin.
Minimal reproduction URL
https://ng-esbuild-minify.netlify.app/
Version
"esbuild-loader": "4.0.2",
Node.js version
v18.17.1
Package manager
npm
Operating system
Windows
Contributions
The text was updated successfully, but these errors were encountered: