question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dealing With Circular Dependencies

See original GitHub issue

Dear @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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brilloutcommented, Mar 20, 2021

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!!

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/brillout/vite-plugin-ssr/issues/12#issuecomment-803457304, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHVQRSMKIZAXRZM7XGBBX3TET7AXANCNFSM4ZPRDDRQ .

0reactions
LydiaFcommented, Mar 20, 2021

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!!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found