BuilderIO / BuilderIO/builder

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`

Open
#3,889 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.8k
Forks
1.2k
Avg merge
1d 6h
Merged PRs (30d)
17

Description

**Describe the bug**
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`. Find more at https://angular.dev/errors/NG0203.
Object.BuilderModule_Factory [as useFactory] (builder.io-angular.mjs:1401:56)

static ɵfac = function BuilderModule_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || BuilderModule)(i0.ɵɵinject(i0.Injector), i0.ɵɵinject(PLATFORM_ID));
};

The Angular latest version 19.1.3
The Builder version: "@builder.io/angular": "^5.0.1", "@angular/elements": "^19.1.4",

**To Reproduce**
Steps to reproduce the behavior:
1. After starting the project the error is showing on runtime in the browser

**Expected behavior**
To show the editor

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the runtime error with Angular 19.1.3/19.1.4 and @builder.io/angular 5.0.1, then inspect the BuilderModule_Factory code in builder.io-angular.mjs around the reported line. Done means the editor starts without NG0203; the issue provides no repository files or failing test to narrow the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.