SvelteKit: Netlify TypeError (void 0) is not a function (500 Internal Error)

Site name: teaches.co.il

I deployed my website (as usual) and for some reason it builds and deploys okay (no error), but when I reach the website’s domain, all pages give “500 Internal Error”.

When I look in Netlify Logs (using the render.mjs provided by SvelteKit), I see this error message:

Oct 19, 03:24:32 AM: e975f4d6 ERROR  TypeError: (void 0) is not a function
    at render_response (file:///var/task/.netlify/functions-internal/render.mjs:84004:31)
    at async respond_with_error (file:///var/task/.netlify/functions-internal/render.mjs:84169:12)
    at async resolve (file:///var/task/.netlify/functions-internal/render.mjs:84856:16)
    at async respond (file:///var/task/.netlify/functions-internal/render.mjs:84882:23)
    at async Runtime.handler (file:///var/task/.netlify/functions-internal/render.mjs:85209:23)

I’m using the latest versions of sveltekit and netlify-build, here’s my package.json:

{
	"name": "teaches-scripts",
	"version": "0.0.1",
	"scripts": {
		"dev": "concurrently \"pnpm run watch:drill\" \"pnpm run dev:svelte\" \"npx http-server build --port 9500\"",
		"dev:svelte": "vite dev --host",
		"watch:drill": "watch \"npm run build:drill\" src",
		"build": "vite build && npm run build:drill",
		"build:drill": "vite build --config vite.config.drill.ts",
		"package": "svelte-kit sync && svelte-package",
		"check:silent": "svelte-kit sync",
		"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
		"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
		"lint": "prettier --plugin-search-dir . --check .",
		"format": "prettier --plugin-search-dir . --write ."
	},
	"devDependencies": {
		"@fortawesome/free-brands-svg-icons": "^6.2.0",
		"@fortawesome/free-solid-svg-icons": "^6.2.0",
		"@macfja/svelte-persistent-store": "^2.2.1",
		"@sveltejs/adapter-auto": "next",
		"@sveltejs/adapter-netlify": "1.0.0-next.81",
		"@sveltejs/kit": "next",
		"@sveltejs/package": "1.0.0-next.5",
		"@sveltejs/vite-plugin-svelte": "^1.0.9",
		"concurrently": "^7.4.0",
		"firebase": "^9.12.1",
		"md5": "^2.3.0",
		"prettier": "^2.7.1",
		"prettier-plugin-svelte": "^2.8.0",
		"rxfire": "^6.0.3",
		"rxjs": "^7.5.7",
		"sass": "^1.55.0",
		"svelte": "^3.52.0",
		"svelte-check": "^2.9.2",
		"svelte-fa": "^3.0.3",
		"svelte-preprocess": "^4.10.7",
		"svelte-qr": "^1.0.0",
		"tslib": "^2.4.0",
		"typescript": "^4.8.4",
		"vite": "^3.1.8",
		"watch": "^1.0.2"
	},
	"type": "module",
	"dependencies": {
		"@types/marked": "^4.0.7",
		"marked": "^4.1.1"
	}
}

I don’t think I’ve changed anything critical in my code. It used to work. now it doesn’t.

Any ideas?

Hi @elron

If the issue is with the render function from Svelte, it is probably best to file an issue on the relevant repository (they maintain the @sveltejs/adapter-netlify plugin.)

Actually I finally got it working when I did “clear cache and redeploy site” in Netlify.
I don’t know why it fixed that issue.

lol

Thanks for your help though

Hey there, @elron :wave:

Thanks so much for coming back and letting us know. This will help future forums folks who encounter something similar.

Happy building :rocket:

1 Like