Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyclic dependencies in ES2015 #45

Open
piotrpalek opened this issue Sep 12, 2019 · 1 comment
Open

Cyclic dependencies in ES2015 #45

piotrpalek opened this issue Sep 12, 2019 · 1 comment

Comments

@piotrpalek
Copy link

Hey, I've been looking into graphitti and saw that you use classes to define relationships in the JS Client.
I'm currently using https://github.com/ghidoz/angular2-jsonapi with the "jsonapi suite" and they use a similar approach for this. But while using it I've had to upgrade to a new angular version, which also upgraded my "target" in tsconfig to es2015.

Now the issue is that it seems that when you change the target, you can no longer define classes that depend on each other in this way, see: ghidoz/angular2-jsonapi#236 (comment). Meaning if you define Post which hasMany Comments, but Comment also belongsTo Post it would throw a Uncaught ReferenceError: Cannot access '<insert class herr>' before initialization error.

Would this be an issue with spraypaint.js as well?

@Petercopter
Copy link

@piotrpalek I came across this issue because I was writing tests and started getting that exact initialization error, but it seems to be because I had my models setup incorrectly.

So to answer your question: Not that I've seen, yet, when things are setup right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants