ryangjchandler/alpine-clipboard

Alpine Error: "TypeError: Cannot read property 'writeText' of undefined"

Closed this issue · 2 comments

I get this error whenever I try to use $clipboard

Alpine Error: "TypeError: Cannot read property 'writeText' of undefined"

Expression: "$clipboard(input)"

NVM, This requires a secure origin — either HTTPS or localhost (or disabled by running Chrome with a flag). Just like for ServiceWorker, this state is indicated by the presence or absence of the property on the navigator object.

From this stackoverflow post: navigator.clipboard is undefined

This was kind of vague at first but after switching from a local to dev environment, this works.