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

template.render is not a function #24

Open
Cubester27 opened this issue Oct 11, 2023 · 5 comments
Open

template.render is not a function #24

Cubester27 opened this issue Oct 11, 2023 · 5 comments

Comments

@Cubester27
Copy link

Cubester27 commented Oct 11, 2023

When I use the render function I get the following error:

image

In render.js an (other) render function is called which doesn't exist (or isn't imported). Does anyone has the same problem?

@pstoebenau
Copy link

To shed some light into this, it looks like this library is using sveltekit's ssr render capabilities. This seems to only be available on the server side though. You'll have to render your emails on the server then use them in the frontend.

@AsafAgranat
Copy link

@pstoebenau thanks for the clarification. Do you have any idea how I can make this rendering dynamic? According to the docs, I need to place the render in a load() function in +page.server.ts (or similar), which means I'll need to create this for every template that I create. But perhaps there's a way to invoke this render dynamically, on demand, so that I place the render function in a single place and pass a component (template) and get the rendered HTML in return?

@thibault60000
Copy link

@pstoebenau thanks for the clarification. Do you have any idea how I can make this rendering dynamic? According to the docs, I need to place the render in a load() function in +page.server.ts (or similar), which means I'll need to create this for every template that I create. But perhaps there's a way to invoke this render dynamically, on demand, so that I place the render function in a single place and pass a component (template) and get the rendered HTML in return?

have you found a solution? I want to generate mail templates in a svelte project in "library" mode, I don't understand how to manage the server part for this lib .

@polaroi8d
Copy link

This issue is still valid. I tried to put the render() function in separate +server.ts or +page.server.ts and got the same error. Any example of how we can resolve the issue?

@mmmoli
Copy link

mmmoli commented May 8, 2024

Stuck with this too!

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

No branches or pull requests

6 participants