Code Monkey home page Code Monkey logo

Comments (15)

schihei avatar schihei commented on September 7, 2024 1

I am using Google Chrome und Mac OS. Version 111.0.5563.64 (Official Build) (x86_64).

from chatbot-ui.

schihei avatar schihei commented on September 7, 2024 1

I just pushed a fix that will prevent that error, but it will return the function such that it won't copy.

It appears to be a case where your clipboard api is unaccessible.

I confirm the patch. :)

from chatbot-ui.

mckaywrigley avatar mckaywrigley commented on September 7, 2024 1

No worries! We at least got rid of that horrible error message. I'll come up with a UX fix here for better visiblility.

from chatbot-ui.

mindsolve avatar mindsolve commented on September 7, 2024 1

Hi, as far as I understand this, clipboard access is only possible in "secure contexts" - i.e. opened via HTTPS or from localhost. This seems to be the case for Chrome and Firefox.

https://developer.mozilla.org/en-US/docs/Web/API/Clipboard

from chatbot-ui.

mckaywrigley avatar mckaywrigley commented on September 7, 2024

What browser?

from chatbot-ui.

quocthinhvo avatar quocthinhvo commented on September 7, 2024

What browser?

Same problem in Chrome.

from chatbot-ui.

mckaywrigley avatar mckaywrigley commented on September 7, 2024

I wonder if either of you have anything enabled that controls your clipboard. Any extensions maybe?

from chatbot-ui.

schihei avatar schihei commented on September 7, 2024

I wonder if either of you have anything enabled that controls your clipboard. Any extensions maybe?

Not really. I also checked the Privacy and Security settings. Sites can ask to see text and images on my clipboard. I also tried to add the page explicitly, but without success.

This is the detailed error message.

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'writeText')

Source
components/Markdown/CodeBlock.tsx (17:28) @ writeText

15 |
16 | const copyToClipboard = () => {

17 | navigator.clipboard.writeText(value).then(() => {
| ^
18 | setButtonText("Copied!");
19 |
20 | setTimeout(() => {
Call Stack
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js (4164:0)
Object.invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js (4213:0)
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js (4277:0)
invokeGuardedCallbackAndCatchFirstError
node_modules/react-dom/cjs/react-dom.development.js (4291:0)
executeDispatch
node_modules/react-dom/cjs/react-dom.development.js (9041:0)
processDispatchQueueItemsInOrder
node_modules/react-dom/cjs/react-dom.development.js (9073:0)
processDispatchQueue
node_modules/react-dom/cjs/react-dom.development.js (9086:0)
dispatchEventsForPlugins
node_modules/react-dom/cjs/react-dom.development.js (9097:0)
eval
node_modules/react-dom/cjs/react-dom.development.js (9288:0)
batchedUpdates$1
node_modules/react-dom/cjs/react-dom.development.js (26140:0)
batchedUpdates
node_modules/react-dom/cjs/react-dom.development.js (3991:0)
dispatchEventForPluginEventSystem
node_modules/react-dom/cjs/react-dom.development.js (9287:0)
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
node_modules/react-dom/cjs/react-dom.development.js (6465:0)
dispatchEvent
node_modules/react-dom/cjs/react-dom.development.js (6457:0)
dispatchDiscreteEvent
node_modules/react-dom/cjs/react-dom.development.js (6430:0)
Hide collapsed frames

from chatbot-ui.

mckaywrigley avatar mckaywrigley commented on September 7, 2024

I just pushed a fix that will prevent that error, but it will return the function such that it won't copy.

It appears to be a case where your clipboard api is unaccessible.

from chatbot-ui.

aweshchoudhary avatar aweshchoudhary commented on September 7, 2024

Working Fine in my case.
image
OS: Linux
Browser: Chrome (Latest Version)

from chatbot-ui.

mckaywrigley avatar mckaywrigley commented on September 7, 2024

Quick follow up - was this locally run or from chatbotui.com?

from chatbot-ui.

schihei avatar schihei commented on September 7, 2024

I am running it on my home server in a Proxmox container.

from chatbot-ui.

aweshchoudhary avatar aweshchoudhary commented on September 7, 2024

Working fine on both the local and chatbotui.com servers.
image

from chatbot-ui.

schihei avatar schihei commented on September 7, 2024

When I run it in a Docker container it works perfectly. Could it be an incompatibility with the Node.js version, etc?

from chatbot-ui.

schihei avatar schihei commented on September 7, 2024

The problem is somehow my browser setting. I apologise for the inconvenience.

CleanShot 2023-03-23 at 15 56 03

from chatbot-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.