I'm struggling to implement a Paddle Inline Checkout in SvelteKit. Every time I try, I keep encountering the error message Name Paddle not found
. It seems like the script is not functioning properly.
Console Error:
Uncaught (in promise) ReferenceError: Paddle is not defined
instance Checkout.svelte:7
init index.mjs:2016
[and so on...]
This is how my component appears:
<svelte:head>
<script src="https://cdn.paddle.com/paddle/paddle.js"></script>
</svelte:head>
<script type="text/javascript" lang="js">
Paddle.Setup({ vendor: 00000 });
Paddle.Environment.set('sandbox');
[script continues...]
I have also attempted placing the script tag in various locations such as in the app.html
body
and head
tags. Even adding async
attribute to the script did not resolve the issue.
It's worth mentioning that I am using TypeScript throughout the entire project, except for this specific portion.