Blog: Few things to know before launching a SvelteKit app in prod

Thank you for the help and feedbacks! Glad we figured out a solution that works for any NodeJS version :+1:

Adding II to SvelteKit is absolutely no issue and straight forward. Basically just a store, a svelte #if, a sign-in and sign-out function and ready to roll.

As we discussed II was not needed, I did not added it in the template but can do if you think that’s useful? We can also have another template later if you think it’s better narrowed? Your call.

I have successfully added II in my local environment and it’s working. I thought that you mentioned that there are some caveats when running on the IC network. If not then all is fine, thanks a lot :slight_smile:

1 Like

Oh yes right, in the dapps I use II I have various polyfill in place. Glad to hear it worked out for you too. Ping me if you notice any issues please. I would be happy to improve the template.

1 Like

Hi @peterparker David,

I am still fighting with the sveltekit template with 14+ DFX versions :frowning:

Before I was able to deploy it at least locally and now not even that as I am getting plenty of JS errors like this one.

Could you or anyone at Dfinity please try to update this template?

Thanks a lot, it would be very helpful.

1 Like

Hi Lukas,

I don’t know what are the plan of the SDK team for these repo. Given the fact that they plan to introduce some templates for dfx, I am guessing that the existing template you mention will be deprecated but, no idea.

Instead, I can suggest you to have a look to Oisy Wallet (https://github.com/dfinity/oisy-wallet) or Juno (https://github.com/junobuild/juno). Both uses SvelteKit with the adapter-static. Oisy Wallet is on Svelte v3 and Juno on Svelte v4.

If you compara package.json, vite and svelte config plus copy the scripts, that should do.

Alternatively, I can have a quick look on my spare time and send you a PR. What’s your repo?

3 Likes

Thanks David, I managed to deploy a plain sveltekit project with the configuration from Juno. This really helped me. :pray:

1 Like

Awesome!!! Let me know if you have any questions regarding the configuration.

1 Like