TypeError - server.init is not a function in svelte kit

I do not encounter any problems in the deployment of the site, but when I try to open the site, I encounter this error. Can you help me ? Thank you in advance

TypeError - server.init is not a function in svelte kit

Stack trace

TypeError: server.init is not a function
    at init (/var/task/.netlify/serverless.js:272:9)
    at Object.<anonymous> (/var/task/.netlify/functions-internal/render.js:3:19)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/var/task/render.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)

Hi @rsldgn14,

Can you provide a reproduction of the issue?

This is not what I meant. Reproduction as in, an example that triggers this problem.

I don’t have a example like that. Sorry for misunderstanding.

How do we see this problem happen then?

Files includes server.init function in serverless.js but program can’t see it. That is problem.

Exactly, there would be some files, right? Probably a repo where you have them? Some code-base you might be working on? Something that you can share which can trigger this behaviour.

var _0SERVER = require(‘./server/index.js’);

function init(manifest)
const server = new _0SERVER.Server(manifest);

	env: process.env


I’m sorry to say, you’re not really helping by providing any useful information. In any case, this appears to be a Svelte issue:

1 Like