Dialog Alert won't close due to: Uncaught (in promise) TypeError: resolve is not a function
How to reproduce:
- go to: https://c0bra.github.io/svelma/components/dialog/
- click "Dialog" button
- click "OK" button (within alert dialog)
Dialog won't close, console output: Uncaught (in promise) TypeError: resolve is not a function at HTMLButtonElement.confirm (Dialog.svelte:146)
Dialog.svelte:146 resolve(hasInput ? prompt: true)
Dialog.svelte:85-87 // export let showClose = true let resolve // export let promise = new Promise((fulfil) => (resolve = fulfil))
The doc and demo was outdated. I have just updated the doc link.
https://docs-abbychau.vercel.app/svelma/components/dialog
Thank you! The documentation demo (at the adress you provided) is working. However, the same issue occures within the library itself. I'm using the library (version 0.4.5) and observe the same behavior as was/is present in the doc demo (at this adress: https://c0bra.github.io/svelma/components/dialog/). I'm not sure however, whether the problem is caused by the fact, that i'm using TypeScript for my project. I will give it a try to solve the issue and on sucess post the fix to help other TypeScript users. Do you have any hint what may cause the problem if the library is used within a TypeScript project?
You could link with git main branch instead of using 0.4.5
git clone https://github.com/c0bra/svelma.git
cd my-project
pnpm link ../svelma
devDependencies:
- svelma 0.4.5
+ svelma 0.4.5 <- ../svelma
Build from local git is also fine
cd svelma
pnpm run build
cd public/build
pnpm pack
During pack svelma-0.4.5.tgz is created in project root. Copy svelma-0.4.5.tgz to the root of your project and do following (don't forget to unlink if it was linked as suggested in previous comment):
# remove first
pnpm rm -D svelma
# and add local package instead
pnpm add -D file:svelma-0.4.5.tgz
Any update on this? The public version seems to be still broken.