Troubleshooting
This ection incldes the offical stencil framework integration references for Angular, React and Vue. Common issue and solutions are also included in this section.
Angular
common errors and solution
NG0203: inject()
must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with runInInjectionContext
.
If you encounter this error in the console.log, it indicates that you are using an outdated version of Angular,
specifically a version lower than 16. To resolve this issue, you have two options. The recommended approach is
to update your Angular version to 16 or higher. Alternatively, if upgrading is not feasible, you can modify
your tsconfig.json
file by adding the necessary configuration lines:
tsconfig.json
{
"compilerOptions": {
"paths": {
"@angular/*": ["node_modules/@angular/*"],
"@dhl-official/*": ["node_modules/@dhl-official/*"]
},
"skipLibCheck": true,
}
}