{"id":17778,"library":"liferay-npm-bundler-plugin-inject-angular-dependencies","title":"Liferay NPM Bundler Angular Dependencies Injector","description":"The `liferay-npm-bundler-plugin-inject-angular-dependencies` package is a specialized plugin for `liferay-npm-bundler` designed to address the challenges of deploying Angular applications within Liferay Portal's npm architecture. Its primary function is to automatically inject necessary peer dependencies (such as `rxjs` for `@angular/forms`) that the Liferay NPM Bundler may not correctly resolve or bundle by default. This ensures Angular packages function correctly at runtime, preventing 'module not found' errors. As of version 1.8.0, it remains critical for bridging the gap until `liferay-npm-bundler` offers full, native `peerDependency` support. The plugin determines the correct dependency versions by scanning the output `node_modules` directory. Its release cadence is typically tied to updates and maintenance within the broader Liferay ecosystem, focusing on compatibility and stability for Angular projects in Liferay Portal.","status":"active","version":"1.8.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install liferay-npm-bundler-plugin-inject-angular-dependencies","lang":"bash","label":"npm"},{"cmd":"yarn add liferay-npm-bundler-plugin-inject-angular-dependencies","lang":"bash","label":"yarn"},{"cmd":"pnpm add liferay-npm-bundler-plugin-inject-angular-dependencies","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This plugin extends the functionality of the Liferay NPM Bundler and requires it to operate.","package":"liferay-npm-bundler","optional":false}],"imports":[{"note":"This plugin is configured as a string identifier within the `.npmbundlerrc` file's `plugins` array, not directly imported into JavaScript or TypeScript application code.","wrong":"import { InjectAngularDependencies } from 'liferay-npm-bundler-plugin-inject-angular-dependencies';","symbol":"inject-angular-dependencies","correct":"{\n\t\"*\": {\n\t\t\"plugins\": [\"inject-angular-dependencies\"]\n\t}\n}"}],"quickstart":{"code":"{\n\t\"*\": {\n\t\t\"plugins\": [\"inject-angular-dependencies\"]\n\t}\n}","lang":"json","description":"This `.npmbundlerrc` snippet globally enables the `inject-angular-dependencies` plugin without any custom options, applying it to all bundles."},"warnings":[{"fix":"Avoid using `dependenciesMap` unless absolutely necessary. Monitor Liferay-NPM-Bundler updates for permanent solutions to dependency issues.","message":"The `dependenciesMap` option is explicitly noted as a temporary workaround. Its use is discouraged except to bypass specific, unaddressed errors, and its behavior or availability may change in future versions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Regularly check `liferay-npm-bundler` release notes for enhancements in `peerDependency` resolution and be prepared to update or remove this plugin.","message":"This plugin mitigates the `liferay-npm-bundler`'s incomplete `peerDependency` support. If `liferay-npm-bundler` introduces full native `peerDependency` handling, this plugin may become obsolete or require significant breaking changes, rendering its current usage incorrect.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Thoroughly test your bundled Angular applications and inspect the dependency tree to ensure the plugin is resolving dependencies as expected without introducing conflicts.","message":"Improper configuration of this plugin, or conflicts with other bundling configurations, can lead to unintended dependency injection, duplicate modules, or unexpected runtime behavior in Angular applications.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Add `\"inject-angular-dependencies\"` to the `plugins` array in your `.npmbundlerrc` file to ensure these dependencies are forcibly injected.","cause":"The Liferay NPM Bundler fails to correctly identify and bundle peer dependencies required by Angular modules (e.g., `@angular/forms` requires `rxjs`).","error":"Cannot find module 'rxjs' or similar 'module not found' errors at runtime for Angular peer dependencies."},{"fix":"Ensure `liferay-npm-bundler-plugin-inject-angular-dependencies` is correctly configured and that no other bundling plugins or manual configurations are causing duplicate or conflicting injections of core Angular libraries.","cause":"Multiple instances or incorrect versions of core Angular/Zone.js dependencies are being bundled, often due to improper peer dependency resolution or conflicting bundling configurations.","error":"Zone.js has detected that ZoneAwarePromise is overwritten."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}