Next.js Discord

Discord Forum

How to not break fast refresh when importing util or external modules

Unanswered
jonahallibone posted this in #help-forum
Open in Discord
I have written an external module for managing my CSP (a quite large one with different options depending on the environment). When I import this into my next.config.ts, fast refresh breaks. I've estimated this has something to do with the turbopack static analysis. My question is: how can i keep my code sane while allowing it to be statically analyzed. there don't seem to be any documented rules around how turbopack calculates change to staleness

0 Replies