Next.js on Plesk

Hi, I have been scratching my head around for a few days not understanding an error message from the plesk server I tend to host my app on. I've tested this host in the past with a bare create-next-app it worked flawlessly, I tried the T3 stack because why not, worked god at home (win/debian) but on the production server ... An then it hit me, it talked about beeing a "module", then I searched why and landed on this comment in the commit that led to it : "imo every project in 2023 should use type: module" So the 2 questions are : - Why should projects be "module" (I didn't quite get the difference between this and ... not) - Should I expect projects build from the T3 template not to work for any reason because on flagging it as not a module ? Thx
Solution:
// entry.cjs async function loadApp() { const { app } = await import("./app.js"); // this is your normal entry file - (index.js, main.js, app.mjs etc.) } loadApp()...
Jump to solution
3 Replies
Fabien
FabienOP•8mo ago
Well ... scratched a little more and got it working (having an entry.cjs calling the ".next/standalone/server.js" did the job)
Solution
Fabien
Fabien•8mo ago
// entry.cjs async function loadApp() { const { app } = await import("./app.js"); // this is your normal entry file - (index.js, main.js, app.mjs etc.) } loadApp()
Fabien
FabienOP•8mo ago
well ... not exactly the right import path, but that's the example I found to get me outta trouble Nice talking to me 😅 see me next time
Want results from more Discord servers?
Add your server