Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError - server.init is not a function #5780

Closed
christopherbecker opened this issue Aug 1, 2022 · 3 comments
Closed

TypeError - server.init is not a function #5780

christopherbecker opened this issue Aug 1, 2022 · 3 comments

Comments

@christopherbecker
Copy link

Describe the bug

Deploying sveltekit to netlify and following these instructions,https://docs.netlify.com/integrations/frameworks/sveltekit/#deployment, produce the following error:

An unhandled error in the function code triggered the following message:

[TypeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) - server.init is not a function
Stack trace

TypeError: server.init is not a function
    at init2 (/var/task/.netlify/functions-internal/render.js:28618:10)
    at Object.<anonymous> (/var/task/.netlify/functions-internal/render.js:28668:15)
    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)

i've used Svelte on Netlify many times, but I'm testing sveltekit out for the first time and I'm getting this error from netlify.

Reproduction

None.

Logs

No response

System Info

Netlify.

Severity

annoyance

Additional Information

No response

@merryt
Copy link

merryt commented Aug 1, 2022

Using @sveltejs/adapter-netlify@1.0.0-next.70 made this error go away, so I think this specific issue might have been introduced in @sveltejs/adapter-netlify@1.0.0-next.71

@Conduitry
Copy link
Member

We need to have an actual reproduction and to know what versions of dependencies you are on. If you updated to the latest version of the Netlify adapter without updating to the latest version of the main @sveltejs/kit package, this error is expected.

@christopherbecker
Copy link
Author

Thanks for your answers and suggestions, in the end it came down to the sveltekit app i created not too long ago was outdated, I updated the entire app to the latest sveltekit and it now builds on netlify. I first noticed the issue by remove the lock file and re-install, the error then said vice is not found and that's when I got the light-bulb moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants