R
Railway2y ago
Seb

Running into issues with SvelteKit deployment

I am running into Is your app correctly listening on $PORT? issues when deploying with SvelteKit (and Vite). This is my vite.config.js
import {sveltekit} from '@sveltejs/kit/vite';
import dotenv from 'dotenv';

dotenv.config();
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],

server: {
port: process.env.PORT || 3000,
}
};

export default config;
import {sveltekit} from '@sveltejs/kit/vite';
import dotenv from 'dotenv';

dotenv.config();
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],

server: {
port: process.env.PORT || 3000,
}
};

export default config;
When I add PORT variable in the Railway app (and I set up some random value), it does deploy on the localhost:XXXX. Why is this happening?
5 Replies
Percy
Percy2y ago
Project ID: 0885c9cf-f4bd-4d7f-8cad-71dd218e6114
Percy
Percy2y ago
⚠️ experimental feature
Seb
SebOP2y ago
0885c9cf-f4bd-4d7f-8cad-71dd218e6114
Seb
SebOP2y ago
Seb
SebOP2y ago
Fixed it with this.
Want results from more Discord servers?
Add your server