Follow

Heads up if you’re using Vite 2 / SvelteKit (beta) with SSR: if you have circular dependencies in your imports, you will get an infinite loop when you try to load the relevant route:

github.com/vitejs/vite/issues/

One (hacky) workaround, is to use dependency injection until it’s fixed:

e.g., if A and B are classes, instead of:

A:
```
import B from 'B'

new B()
```

B:
```
import A from 'A'

new A()
```

do:

A:
```
import B from 'B'

new B(A)
```

And in B save a reference to A and use that.

· · Web · 0 · 1 · 2
Sign in to participate in the conversation
Aral’s Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!