• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question SvelteKit and Plesk Node : TypeError: Cannot read properties of undefined (reading 'on')

MarcelP

New Pleskian
Server operating system version
Debian 10.13
Plesk version and microupdate number
18.0.58
I'm encountering an issue while deploying a SvelteKit demo application on a Plesk server. After following the steps to get the SvelteKit demo ready for production, I performed a build which resulted in two directories: client/ and server/ and some files. To start the application, I created an entry.cjs file with the following line:
(() => import('./index.js'))();

I then set this entry.cjs file as the startup file in the Node.js application settings on Plesk.
However, when I try to access the application via the browser, I receive the following error:
App 32610 output: server.server.on(
App 32610 output: ^
App 32610 output:
App 32610 output: TypeError: Cannot read properties of undefined (reading 'on')
App 32610 output: at file:///var/www/vhosts/programr.events/httpdocs/build/index.js:285:15

It seems this error is related to an attempt to access an on method on an undefined server object. Here are the steps I've taken for deployment:
  • Build the SvelteKit application using npm run build, which producesclient/ and server/ directories.
  • Creation of the entry.cjs file to start the application.
  • Configuring entry.cjs as the startup file on Plesk.
1709931745122.png

I'm a bit lost on how to resolve this issue. Has anyone encountered this error before, or does anyone have an idea on how to correctly configure a SvelteKit application for deployment on a Plesk server?

Thank you in advance for your help.
 
Back
Top