JohnWeisz/TypedJSON

JS: [ERROR]: ReferenceError: Cannot access 'Pos' before initialization

Closed this issue · 6 comments

My project is relatively large and there are many classes. I encountered this problem after packaging android. I would like to request assistance

@jsonObject
export class Vertex {
	@jsonMember(Number)
	private Index: number;
	@jsonMember(AnyT)
	private Data: any;
	// @jsonMember(() => Vertex)
	// private Next: Vertex;
	constructor(index: number, data: any) {
		this.Index = index;
		this.Data = data;
		// this.Next = next;
	}
}

I find the reason is the class Vertex Circular reference.May you fix it ?thanks very much!

@AnkoGo123, I assume this is the same issue as #189?

This issue should be resolved in my fork: https://github.com/decoverto/decoverto

@AnkoGo123, I assume this is the same issue as #189?

This issue should be resolved in my fork: https://github.com/decoverto/decoverto

thank you very much. I had try it and it can go work well. But I have a quetion: the "[decoverto]" can work normally together with the "[typedjson]"?

Decoverto can be used next to TypedJSON though they use different decorators and conversion methods. I would recommend against mixing them since it might be confusing. The fork is a replacement of TypedJSON.

thanks!!

Decoverto can be used next to TypedJSON though they use different decorators and conversion methods. I would recommend against mixing them since it might be confusing. The fork is a replacement of TypedJSON.

hello,may you help me in decoverto/decoverto#2?