Dealing With Circular Dependencies
See original GitHub issueDear @brillout,
We are encountering circular dependencies when using recursive functions. I was wondering if this is something to do with vite & ssr, or whether it was perhaps your package. I thought it might be just vite & ssr because there is an issue about it, but I thought it might be your package as all the circular dependencies begin with this: /Users/home1/code/lt/csvite/node_modules/vite-plugin-ssr/user-files/infra.node.vite-entry.ts -> /src/pages/tests/index.page.tsx -> ...
I tried putting this in vite.config.ts, but it didn’t do anything.
build: {
rollupOptions: {
onwarn(warning, rollupWarn) {
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
rollupWarn(warning)
}
},
},
},
Thank you (again!) for any pointers and apologies if this is nothing to do with vite-plugin-ssr!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to Eliminate Circular Dependencies from Your JavaScript ...
In my experience, the best way to deal with circular dependencies is to avoid them altogether. Circular dependencies are usually an ...
Read more >How to solve circular dependency?
Try identify your objects going backwards asking what (object) do you need for previous one to work - for example: File(filename).write(Report); ...
Read more >Circular Dependencies in Spring - Baeldung
A quick writeup on dealing with circular dependencies in Spring: how they occur and several ways to work around them.
Read more >How to fix nasty circular dependency issues once and for all in ...
First, this is ugly and doesn't scale. In a large code base, this will result in moving imports randomly around until stuff just...
Read more >Circular dependency - Wikipedia
In software engineering, a circular dependency is a relation between two or more modules which either directly or indirectly depend on each other...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s Not that Bad just Stick to résolve each dependency one by one
On Sat 20. Mar 2021 at 21:16, LF @.***> wrote:
Dear Romuald,
Thank you so much for your help and even more so the encouragement/nudge!!
I was able to resolve this
/comps/index.ts -> /comps/handleObject.js -> /comps/index.ts
using the solution in stack overflow…But, in our code these functions had more than just ‘one door’, you can call handleObject() in and of itself. Anyway I have surprised myself and managed to work out how to do it!!!
Nevertheless I might hold out for as long as I can for 2258 as this is going to be horrible refactor…
THANK YOU!!