Coder Social home page Coder Social logo

Comments (10)

haimh avatar haimh commented on August 15, 2024 3

Fresh Install git clone today 11.12.2023 => Error in Firefox Console yarn dev

[NoScript]:0 Prompt Hook installation http://PRIVATE-IP_ADDRESS:5173/ [log.js:32:13]
[vite] connecting... [client:229:9](http://PRIVATE-IP_ADDRESS:5173/@vite/client)
[vite] connected. [client:324:21](http://PRIVATE-IP_ADDRESS:5173/@vite/client)
Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools 
(http://PRIVATE-IP_ADDRESS:5173/node_modules/.vite/deps/chunk-BIYOIT3O.js?v=e7e990c6)
Uncaught TypeError: crypto.randomUUID is not a function
    <anonymous> http://PRIVATE-IP_ADDRESS:5173/src/main.tsx:6
[main.tsx:6:48](http://PRIVATE-IP_ADDRESS:5173/src/main.tsx)

What can I do?

you could go to ./frontend/src/main.tsx and change to use uuid package as bellow:

import { v4 as uuidv4 } from "uuid";
....
if (document.cookie.indexOf("user_id") === -1) {
// document.cookie = opengpts_user_id=${crypto.randomUUID()};
document.cookie = opengpts_user_id=${uuidv4()};
}

*Note: use npm install uuid for using uuid instead of crypto

Hope that help.

from opengpts.

luquitared avatar luquitared commented on August 15, 2024 2

As @tibraga said, if developing locally, route to http://localhost:{your_port} rather than http://0.0.0.0:{your_port}

However, fixing this during deployment is problem is a different issue

from opengpts.

waleking avatar waleking commented on August 15, 2024 2

It works for me! Now I can visit opengpts remotely! Amazing fix!
And I also changed all the crypto.randomUUID() to uuidv4() in frontend/src/hooks/useConfigList.ts and frontend/src/hooks/useChatList.ts. It's necessary to access opengpts remotely.

My environment: chrome (local) + docker (remote)
Thank you!

you could go to ./frontend/src/main.tsx and change to use uuid package as bellow:

import { v4 as uuidv4 } from "uuid"; .... if (document.cookie.indexOf("user_id") === -1) { // document.cookie = opengpts_user_id=${crypto.randomUUID()}; document.cookie = opengpts_user_id=${uuidv4()}; }

*Note: use npm install uuid for using uuid instead of crypto

Hope that help.

from opengpts.

LeonardFluent avatar LeonardFluent commented on August 15, 2024

me too

from opengpts.

weetoktech avatar weetoktech commented on August 15, 2024

me too. Any suggestions?

from opengpts.

tibraga avatar tibraga commented on August 15, 2024

It's because the lib only works with localhost or https domain.

from opengpts.

2922832737C avatar 2922832737C commented on August 15, 2024

我想部署到服务器上,但是就像上边所说的,我通过ip地址访问不到,这该怎么解决

from opengpts.

hugofreire avatar hugofreire commented on August 15, 2024

Any update on this?

from opengpts.

zwilch avatar zwilch commented on August 15, 2024

Fresh Install git clone today 11.12.2023 => Error in Firefox Console
yarn dev

[NoScript]:0 Prompt Hook installation http://PRIVATE-IP_ADDRESS:5173/ [log.js:32:13]
[vite] connecting... [client:229:9](http://PRIVATE-IP_ADDRESS:5173/@vite/client)
[vite] connected. [client:324:21](http://PRIVATE-IP_ADDRESS:5173/@vite/client)
Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools 
(http://PRIVATE-IP_ADDRESS:5173/node_modules/.vite/deps/chunk-BIYOIT3O.js?v=e7e990c6)
Uncaught TypeError: crypto.randomUUID is not a function
    <anonymous> http://PRIVATE-IP_ADDRESS:5173/src/main.tsx:6
[main.tsx:6:48](http://PRIVATE-IP_ADDRESS:5173/src/main.tsx)

What can I do?

from opengpts.

zwilch avatar zwilch commented on August 15, 2024

you could go to ./frontend/src/main.tsx and change to use uuid package as bellow:
import { v4 as uuidv4 } from "uuid"; .... if (document.cookie.indexOf("user_id") === -1) { // document.cookie = opengpts_user_id=${crypto.randomUUID()}; document.cookie = opengpts_user_id=${uuidv4()}; }
*Note: use npm install uuid for using uuid instead of crypto
Hope that help.

that helped me, thank you

from opengpts.

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.