Avoiding cyclical dependencies in Next.js #759
-
We're using the Next.js version, and running into an issue where we cannot use Queues (ie. call .enqueue) in any lib-type files throughout the app that are shared between API routes. Since multiple routes depend on the lib files, importing one of those routes from the lib file itself results in a cyclical dependency. I think we may be able to work around this w/dynamic imports and/or disabling eslint on certain lines, but just curious if anyone else has run into this or if there's a clear solution I'm missing. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi David! Excuse my late reply, I was on vacation. Is the error you’re seeing a lint warning, or does it translate into runtime errors as well? If that‘s the case, a reproduction code sample would be super helpful to give a good answer. If it‘s „only“ a lint error, i’d consider it a false warning. |
Beta Was this translation helpful? Give feedback.
Hi David! Excuse my late reply, I was on vacation.
Is the error you’re seeing a lint warning, or does it translate into runtime errors as well? If that‘s the case, a reproduction code sample would be super helpful to give a good answer. If it‘s „only“ a lint error, i’d consider it a false warning.