When starting prodigy i get an error in the browser on crypto.randomUUID. I tested Chrome and Firefox. Any ideas. Thanks
Welcome to the forum @bogdann!
Could you share the exact error that you're getting?
The crypto.randomUUID
related error typically occurs when using an older browser version that doesn't support this Web Crypto API feature, which Prodigy uses for generating unique identifiers.
Could you check your browsers can support it? If not, then updating it should resolve the issue.
You can also check if your browser supports by opening developer tools and typing in console:
typeof crypto.randomUUID === 'function'
It should return true
if the function is supported.
Other than that I would need to know the exact error message if possible and whether you're accessing Prodigy via local host or remote server.
Thanks!
Hi and thanks for the prompt answer.
I get 'true' in the console so that means the browser supports it.
The error in the browser is this (i cannot put the whole error as I am limited to 5 links):
TypeError: crypto.randomUUID is not a function
_LabelList@http://s-olaf-i2conn.olaf.cec.eu.int:8989/bundle.js:227:47831
bundle.js/createWithStyles2/</WithStyles<@http://s-olaf-i2conn.olaf.cec.eu.int:8989/bundle.js:74:39370
div
div
_Heading@http://s-olaf-i2conn.olaf.cec.eu.int:8989/bundle.js:227:39074
bundle.js/createWithStyles2/</WithStyles<@http://s-olaf-i2conn.olaf.cec.eu.int:8989/bundle.js:74:39370
I am starting the server with the following command: PRODIGY_HOST="s-olaf-i2conn" PRODIGY_PORT=8989 prodigy ner.manual ner_news_headlines blank:en ./news_headlines.jsonl --label PERSON,ORG,PRODUCT,LOCATION
Thanks
Thanks @bogdann.
Looking at the stacktrace it looks like Prodigy is running on intranet and you're accessing via http://
and we're looking at client-side error occurring during component rendering.
Could you try accessing via localhost
or https
to see if the lack of secure context is the issue here?
Another thing to check would be whether there's any org proxy or security policy that might be interfering with the Web Crypto API.
Hi, I am also having this issue.
Command:
python -m prodigy pdf.image.manual papers ./pdfs --labels FIGURE,FOOTNOTE,PARAGRAPH
Prodigy.json:
{
"host": "0.0.0.0",
"PRODIGY_LOGGING": "verbose"
}
When I run the app in the same machine, it works. When I run the app in another machine in the same network, it shows the error as below:
Error:
TypeError: crypto.randomUUID is not a function
at _ToolbarCheckbox (http://192.168.1.31:8080/bundle.js:308:11488)
at http://192.168.1.31:8080/bundle.js:74:39370
at div
at div
at _Toolbar (http://192.168.1.31:8080/bundle.js:227:50186)
at http://192.168.1.31:8080/bundle.js:74:39370
at div
at _class2 (http://192.168.1.31:8080/bundle.js:79:44123)
at ShortcutsWrapper (http://192.168.1.31:8080/bundle.js:227:40389)
at div
at _Heading (http://192.168.1.31:8080/bundle.js:227:39076)
at http://192.168.1.31:8080/bundle.js:74:39370
at _ImageManualNew (http://192.168.1.31:8080/bundle.js:308:18016)
at http://192.168.1.31:8080/bundle.js:74:39370
at ImageManual (http://192.168.1.31:8080/bundle.js:308:34971)
at div
at div
at div
at _class2 (http://192.168.1.31:8080/bundle.js:79:44123)
at ShortcutsWrapper (http://192.168.1.31:8080/bundle.js:227:40389)
at _Pages (http://192.168.1.31:8080/bundle.js:308:47656)
at http://192.168.1.31:8080/bundle.js:74:39370
at div
at _CardWithoutTheme (http://192.168.1.31:8080/bundle.js:308:98012)
at http://192.168.1.31:8080/bundle.js:74:39370
at Card (http://192.168.1.31:8080/bundle.js:308:100882)
at ErrorBoundary (http://192.168.1.31:8080/bundle.js:308:141286)
at div
at div
at _Annotator (http://192.168.1.31:8080/bundle.js:308:146003)
at http://192.168.1.31:8080/bundle.js:74:39370
at ConnectFunction (http://192.168.1.31:8080/bundle.js:64:13204)
at main
at div
at _class2 (http://192.168.1.31:8080/bundle.js:79:44123)
at _Main (http://192.168.1.31:8080/bundle.js:308:162714)
at http://192.168.1.31:8080/bundle.js:74:39370
at ConnectFunction (http://192.168.1.31:8080/bundle.js:64:13204)
at ThemeProvider3 (http://192.168.1.31:8080/bundle.js:68:121250)
at App (http://192.168.1.31:8080/bundle.js:310:7100)
at Provider (http://192.168.1.31:8080/bundle.js:68:1343)
Hi @paradm,
Thank for the report - which browser and which version of it are you using when the issue occurs?
I am using the latest version of chrome and edge.
Edge: Version 133.0.3065.69 (Official build) (64-bit)
Chrome: Version 133.0.6943.99 (Official Build) (64-bit)
Thanks again for providing additional information about your environment. Since you can access the app with the local host and not remotely, we suspect there's something about the network connection that compromises the secure context and crypto.randomUUID
is only available in secure contexts.
Since it is not essential for Prodigy to use crypto.randomUUID
to generate the IDs, we have just released a version 1.18.0a1 that uses uuid
package instead.
Could you install this version of Prodigy and see if that fixes your issue?
To install a specific version of Prodigy using pip, run:
python -m pip install prodigy==1.18.0a1 -f https://XXXX-XXXX-XXXX-XXXX@download.prodi.gy
Thank you.
Yes. This version solves the issue. Thanks!