Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Circular dependencies need to be fixed #16

Closed
AndrewFarley opened this issue May 29, 2022 · 2 comments
Closed

Circular dependencies need to be fixed #16

AndrewFarley opened this issue May 29, 2022 · 2 comments

Comments

@AndrewFarley
Copy link
Contributor

Because there are circular dependancies there is memory leaks and constantly increasing memory usage of Next.js. After some research this appears to be related to and/or because of..

vercel/next.js#34659
nodejs/node#42080

I used an wonderful tool to help figure this out called madge and ran it with the following command...

npx madge   -c --extensions ts,tsx --exclude "test*" -l dot --dot  -i test.png ./

Which outputs the file explaining the circular dependencies...

circular-deps

I might also recommend to after fixing our circular deps, to integrate this tool into our testing and to basically fail out and don't let new code with circular dependencies to be merged into master.

@darrenvong
Copy link
Member

Is this actually happening in production? Hot reload should not be enabled/used in production as it's mainly for fast feedback during development when we change some code. It creates some impossible scenarios like loading modules multiple times and so we may be better off disabling that first, then fix the circular imports.

@AndrewFarley
Copy link
Contributor Author

Because we no longer use dependencies/modules in production I'm going to close this. Can re-open at a later time if needed.

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

No branches or pull requests

3 participants