Open ElliotFriend opened 1 week ago
I managed to find a workaround, if it's any help in troubleshooting. Changing the vite.config.js
file so it doesn't "externalize" these dependencies managed to get it working. Here's the changed file in the commit. And it was these packages I added to the noExternal
array:
{
ssr: {
noExternal: [
'@creit.tech/stellar-wallets-kit',
'@stellar/freighter-api',
'@lobstrco/signer-extension-api',
],
},
}
I'm not really sure what "externalizing" a dependency even means, but here's the vite docs about this option
Hi there, not really sure what that configuration does in Vite but assuming for the "SSR" it must be some sort of logic to skip using those libraries during the server side rendering process (but I could be wrong)
It's curious because the testing page for development is using Vite https://github.com/Creit-Tech/Stellar-Wallets-Kit/blob/d8933ae33e484e99b68943ba1c6264dbd3a57e73/package.json#L29
I will be investigating about this during the week and fix it
I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project
Summary
I've created a vanilla SvelteKit app, using
npx sv create my-app
, selecting the most barebones options, using TypeScript.I import the wallet kit components just like in the documentation:
And that's enough to throw an error. I'm experiencing the exact same trouble as reported in #11 where I see an error about ES modules and commonjs.
SvelteKit uses vite under the hood, so perhaps the problem is with that? I don't know nearly enough about the specifics that go into packaging, building, etc. So, I'm a bit at a loss.
Creating a brand new React app gave me no such errors.