t3 workflow?

I'm in the dark on the t3 infrastructure and how it affects the development process, and I don't think it's meta enough for #ct3a-meta. I'm trying to add an email provider using Next-Auth. I've been making changes to its files (eg, ./node_modules/next-auth/providers/email.js), but they don't seem to make it to the app. The Next dev environment's HMR doesn't hot-reload packages like Next-Auth, correct? I have to restart the app for changes in them to take effect? No logging output shows up in the server output (terminal). Where should they appear, and what would prevent them? The email provider needs the nodemailer package, but it doesn't appear to get imported. Is it supposed to be added in the project's root package, or Next-Auth's?
2 Replies
Sturlen
Sturlen2mo ago
1. I would suggest not editing packeages in node_modules. these changes can be overwritten at any new install and will not be version controlled. 2. Next should hot-reload on any changes made to source files in your project. it might not be watching the node_modules folder 3. Anyconsole.log done on the server should output in the console on the server. 4. run npm install nodemailer in your project root. after that nextauth will be able to use it. NextAuth has several ways of customizing providers. and if that's not enough I'd recommend creating your own provider rather that editing node_modules. I highly recommend you check out the examples the docs
Huperniketes
Huperniketes2mo ago
Thanks for your reply. You've confirmed my understanding of how it should work, so I'll continue digging into the anomalies I see. On 3, I had to add an option to the config object in next.conf.js for logging statements to work:
const config = {
compiler: {
removeConsole: false,
},
}
const config = {
compiler: {
removeConsole: false,
},
}
Changes in node_modules aren't picked up without modifying the next.conf.js config, which causes the server to be restarted. You can touch the file which causes it to be restarted, but the config must be changed for code in node_modules to be reloaded or the server will just reload whatever was in its cache.