-
-
Notifications
You must be signed in to change notification settings - Fork 266
clipboard-copy causing problems in svelte kit #669
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
Comments
thumbs up for @OG84 for those who r still having issues when using a vanilla svelte + vite 2, you can adjust the vite.config.js as follow
|
Duplicate of #598 |
It is no longer necessary to instruct vite to optimize The Instead, Note: the Overriding default copy behaviorOverride the default functionality through the <script>
import copy from "clipboard-copy";
import { CopyButton } from "carbon-components-svelte";
</script>
<CopyButton text="hello" copy={text => copy(text)} /> Preventing default copy behaviorPass a "no-op" empty function to prevent the component from copying text at all. <script>
import { CopyButton } from "carbon-components-svelte";
</script>
<CopyButton text="hello" copy={() => {}} /> |
Uh oh!
There was an error while loading. Please reload this page.
with [email protected] my svelte kit app fails with
As a workaround I had to add
clipboard-copy
to the optimizeDeps in svelte config.The text was updated successfully, but these errors were encountered: