New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
circular dependency in next\dist\lib\router\index.js #5392
Comments
Is this issue will be fixed with next-server ? @timneutkens |
Closing this in favor of #5927 (the serverless target will output much smaller bundles than the solution outlined in this issue would) |
The current size of my built next directory is over 500m because of some huge node_modules containing unnecessary code. I currently run the next build result on Amazon Beanstalk but the sheer size of the builds causes extra storage cost, and startup delay. It is great that next.js serverless is getting smaller, but I believe this ticket should remain open for those not able to use serverless yet (websockets, node_modules too big for now v2 disk limits, etc). Is it possible to leverage similar principles from 5927 that make serverless smaller to get smaller bundles using the traditional |
@timneutkens I'm setting up rollup for next-i18next and have noticed the same circularity warning. I'm on Next v7.0.2. Is this something that's coming in the 8.x release? |
@isaachinman you should mark the |
Makes sense, thanks. |
I am trying to build a zip file only containing the code I need for production deployment. Smaller builds benefit nearly all production users: cheaper to store indefinitely, quicker to roll out after build finish, faster to load cold start in serverless, and for large projects it is easy to go over serverless dist limits without optimized distribution. I believe rollout is the best option for getting an optimized build.
The good news, running rollup turns my 60m dist file into 6m. I believe this concept will be a huge win for people who want their next.js app to start as quick as possible.
Bad news: When I try to run rollup on my next.js build, I get a circular dependency issue that I believe stops the result from running:
Would it be possible to not have a circular dependency between index.js and routes.js?
Here are the files I am using for testing this, hopefully this might help someone more experienced carry on from where I am stuck:
rollup.config.js
(external has a few exclusions due to circular dependencies that need to be taken up with those package owners.)
create rollup (note circular dependency issue)
to run
error I get but I suspect it is because of circular dependency
Can anyone weigh in on:
The text was updated successfully, but these errors were encountered: