Next.js Discord

Discord Forum

Webpack watch and turborepo

Unanswered
European hornet posted this in #help-forum
Open in Discord
European hornetOP
Seems to be that when i modify a package that is exposed via package.json this one is not updating the app that is managed by webpack using devserver and watch mode,

is there a way to make work ?

Note: i know that for default anything under node_modules is skipped for performance reasons, but these packages are under node_modules for example node_modules/@repo/sharedLib1

any suggestions ?

16 Replies

European hornetOP
the package is not compiled is raw, and the stuff is exposed in his package.json thats the weird thing
when i do a change, webpack do the rebuild, but the change is not reflected
so im confused there
when i used a monorepo, i was pretty sure that i had to reload my app whenever i make changes to the dependencies
European hornetOP
yes, if i stop my webpack devserver and start it again, fully works
is jut the HMR somehow is fucked
is the only issue i have for the moment with turborepo + an app built using webpack
does it work if you simply reload the page? so keep the server running but reload the page in the browser (instead of waiting for hot module reload to work)
European hornetOP
yep i reload the page and nothing, so im not sure if is a cache problem, or webpack is not loading the change properly, or maybe im doing something wrong
im afraid you can't do much here, since as far as nextjs is concerned, node_modules is constant so it doesn't track the changes
European hornetOP
i was searching a lot, but this kind of issues are not easy to fix
if transpiling doesn't work, then i'm out of idea and i'm pretty sure you can't do anything other than patching the nextjs dev server source code
European hornetOP
probably is webpack directly, im not sure is even related to nextjs
but thanks for your time @joulev