Skip to content

[webpack.cache.PackFileCacheStrategy] Serializing big strings on nextjs middleware. #70689

Answered by icyJoseph
siamahnaf asked this question in Help
Discussion options

You must be logged in to vote

I think the problem might be:

//Navigation
import { AdminNavs, ModeratorNavs } from './Components/Sidebar/data';

Which in turn imports a lot of react-icons and stuff, making the middleware file size very large.

You should refactor so that, AdminNavs, and ModeratorNavs, do not reference the icons, and make another file where you map over AdminNavs, and ModeratorNavs, assigning the icons, and export the result, so that the middleware file does not see the icons.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@icyJoseph
Comment options

@siamahnaf
Comment options

@icyJoseph
Comment options

@siamahnaf
Comment options

@icyJoseph
Comment options

Answer selected by siamahnaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants