Programming and development have become far easier than they used to be only a few years ago. However, random error messages and bugs are still an everyday issue for most programmers. That said, while most error messages are now pretty self-explanatory, you’ll come across a few that’ll leave you scratching your head occasionally.Â
In this article, we’re talking about the “Error: Emit attempted before angular webpack plugin initialization” issue, its causes, and how to fix the problem.Â
What causes the “Error: Emit attempted before angular webpack plugin initialization” issue?
The error message occurs when there’s an issue with the Angular Webpack plugin initialisation. Alternatively, you can also run into this error if the NGCC or Angular Compatibility Compiler fails to process the package properly.
The Angular compiler also requires certain compiler options on initialisation. If these options aren’t present or are incorrectly set, you can run into this problem.
Also read: Fix: Python setup.py egg_info did not run successfully
How to fix the “Error: Emit attempted before angular webpack plugin initialization” issue?
Here are three fixes you can try out.
Update your configuration files
One of the easiest solutions for the problem is to add the following line to your tsconfig.app.json file.Â
"angularCompilerOptions": { "enableIvy": false }
Once done, restart your project and check to see if the error persists.

Upgrade your Typescript version
Using an older Typescript version, upgrading your Angular version can break things. Based on which version of Angular you’re using, update your package.json file accordingly.
For Angular 15
"devDependencies": {
...
"typescript": "~4.8.0"
}
For Anglular 14
"devDependencies": {
...
"typescript": "~4.7.0"
}
If it doesn’t work, make sure to install the required version of Typescript before trying again. You can use this command.
npm install typescript@"~[enter version number]" --save-dev
Upgrade your Node version
Last, upgrading your Node version has also been known to fix the problem. If you’re still running Node version 16 or lower, try upgrading to version 18 (LTS) to see if that fixes the problem. You can use the command given below.Â
nvm install node --reinstall-packages-from=node

Also read: How to add a header file in Dev C++?