question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: render2 is not a function

See original GitHub issue

Not sure if this is a bug This is the only difference Production: node version 14.17.0 Dev: node version 14.16.0

When I run npm run build on dev it works but not on a production self hosted server this is what I get

✓ 76 modules transformed.
.svelte-kit/output/server/app.js   501.50kb
Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-node
TypeError: render2 is not a function
    at Object.handle (file:///home/admin/web/mylastore.com/public_html/.svelte-kit/output/server/app.js:80:26)
    at respond (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/ssr.js:1514:30)
    at Module.render (file:///home/admin/web/mylastore.com/public_html/.svelte-kit/output/server/app.js:319:10)
    at visit (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:131:30)
    at prerender (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:245:11)
    at async Object.prerender (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:312:5)
    at async adapt (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/adapter-node/index.js:28:4)
    at async adapt (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:338:2)
    at async file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/cli.js:654:5
> 500 /
Error: 500 /
    at error (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:94:11)
    at visit (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:176:5)
    at async prerender (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:245:5)
    at async Object.prerender (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:312:5)
    at async adapt (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/adapter-node/index.js:28:4)
    at async adapt (file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/chunks/index7.js:338:2)
    at async file:///home/admin/web/mylastore.com/public_html/node_modules/@sveltejs/kit/dist/cli.js:654:5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
rsdaviscommented, Jun 21, 2021

If you are running into this (as I just did when updating), you need to rename “render” to “resolve” for the function argument in the hooks.js file. This file is included as part of the template, but it’s optional, and it’s likely you can just remove the file without an issue.

2reactions
mylastorecommented, Jun 2, 2021

ok, updated to latest svelte and something else broke, but manage to correct that also and now the site is working on production server.

under svelte hooks they rename the method “render” to “resolve” export async function handle({ request, render }) { to export async function handle({ request, resolve }) {

  "@sveltejs/adapter-node": "^1.0.0-next.24",
  "@sveltejs/kit": "^1.0.0-next.112",
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Context: TypeError: render is not a function
The problem is I seem to be getting an error 'TypeError: render is not a function. (In render(newValue), render is an instance of...
Read more >
10193 (TypeError: a.render is not a function) - CKEditor
I just downloaded CKeditor 4.1RC (full package) and get the following error when I try to assign items the custom default toolbar :...
Read more >
render is not a function????? (Example) - Treehouse
render is not a function ????? I am try Use Context API but having this Strange error. Context/index.js. const AmazonContext = React.
Read more >
Children of Consumer without new line gives "TypeError ...
I get a confusing error when not using a new line in the children of a ... new line gives "TypeError: render is...
Read more >
Javascript – React Context: TypeError: render is not a function
The problem is I seem to be getting an error 'TypeError: render is not a function. (In render(newValue), render is an instance of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found