Current heuristics of optimizeDeps.entries: ["routes/**"] turns out to be a bit erroneous since it tries to pre-bundle entire server dependency and causes issues (warning?) for examples
It's not so critical since it shouldn't be that hard to manually identify such "server heavy" deps and configure by themselves, but the error message looks quite shocking at first for new users, so probably need to do something.
Simplest heuristic would be to crawl only local files (e.g. under app/) and find "use client" on our side, then use it as optimizeDeps.entries.
Current heuristics of
optimizeDeps.entries: ["routes/**"]
turns out to be a bit erroneous since it tries to pre-bundle entire server dependency and causes issues (warning?) for examples@node-rs/argon2
in https://github.com/hi-ogawa/lucia-auth-examples/pull/1#discussion_r1675537887bcrypt
in https://github.com/hi-ogawa/next-learn/pull/1It's not so critical since it shouldn't be that hard to manually identify such "server heavy" deps and configure by themselves, but the error message looks quite shocking at first for new users, so probably need to do something.
Simplest heuristic would be to crawl only local files (e.g. under
app/
) and find"use client"
on our side, then use it asoptimizeDeps.entries
.