0

I'm trying to deploy a Nuxt 3 website on Plesk, compiled with yarn build. I therefore have the PUBLIC and SERVER folders, which I have on Plesk hosting.

I have the server.js file which is the following:

`const app = require('./.output/server/index.mjs'); const http = require('http');

http.createServer(app).listen(process.env.PORT);`

I can't find a single guide for Nuxt 3, I need to start the application. From my understanding though, Phusion should start processes without launching a manual start command?

Thank you very much

Marghen
  • 255
  • 2
  • 6

1 Answers1

2

I solved my problem, and it is way easier than I anticipated: What you need to do is simply create a server.js file, containing 1 line:

import('./server/index.mjs');

which is the file generated by nuxt3 in ./output/server/index.mjs.

That's all. I was definitely overcomplicating it coming from nuxt2, I hope it can save time to others.

Marghen
  • 255
  • 2
  • 6
  • Hi @Marghen, did you have any problems with Phusion Passenger crashing your nuxt3 app randomly? It is happening to me and I am clueless maybe you have encountered same problem :) – iSnuff Apr 30 '23 at 09:54
  • Hi @iSnuff, no I'm sorry, it didn't happen to me yet (fortunately). I don't know if it helps, but we've had some troubles with Phusion Passenger and nuxt 3 in the past and if I recall correctly the problem was a misconfiguration of the nuxt3 app on https. I'm not exactly sure what it was but adding some advanced configuration in nuxt.config made everything work great. What Node version are you setting up Nuxt with? – Marghen May 08 '23 at 07:20