Error: 'faceapi' is not defined.
Hi thanks for your sharing, but I don't know why this can't work. Could you help me? Any advice will be appreciate!
/script.js faceapi is not defined browser 'faceapi' is not defined. (no-undef) eslint

It looks like you are not including the faceapi script in your HTML file.
On Wed, Oct 2, 2019 at 6:04 PM yinglanh [email protected] wrote:
Hi thanks for your sharing, but I don't know why this can't work. Could you help me? Any advice will be appreciate!
/script.js faceapi is not defined browser 'faceapi' is not defined. (no-undef) eslint
[image: Screen Shot 2019-10-03 at 9 01 04 am] https://user-images.githubusercontent.com/48505160/66087958-af597a80-e5bc-11e9-9faa-7b99646aa7a9.png
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/8?email_source=notifications&email_token=AJPAR22S3PTUL2RRL3OSMJ3QMUSJRA5CNFSM4I44NEK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HPIMOUQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AJPAR2ZUGXHO5WTEJBDWOBLQMUSJRANCNFSM4I44NEKQ .
It looks like you are not including the faceapi script in your HTML file. …
I do. But I don't know for some reason it just doesn't work.

Interesting. Could it possible be the editor you are using? I am not sure what editor you are using, but it is much different than anything I have ever seen.
On Wed, Oct 2, 2019 at 6:11 PM yinglanh [email protected] wrote:
It looks like you are not including the faceapi script in your HTML file. … <#m_6062900433162855676_>
I do. But I don't know for some reason it just doesn't work.
[image: Screen Shot 2019-10-03 at 9 09 11 am] https://user-images.githubusercontent.com/48505160/66088166-900f1d00-e5bd-11e9-9f66-78253745afb1.png
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/8?email_source=notifications&email_token=AJPAR265DWMJEXOVQV7PCQLQMUTAXA5CNFSM4I44NEK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAGPDYI#issuecomment-537719265, or mute the thread https://github.com/notifications/unsubscribe-auth/AJPAR26SX4PZGOCBGCSN4ZLQMUTAXANCNFSM4I44NEKQ .
Interesting. Could it possible be the editor you are using? I am not sure what editor you are using, but it is much different than anything I have ever seen. … On Wed, Oct 2, 2019 at 6:11 PM yinglanh @.***> wrote: It looks like you are not including the faceapi script in your HTML file. … <#m_6062900433162855676_> I do. But I don't know for some reason it just doesn't work. [image: Screen Shot 2019-10-03 at 9 09 11 am] https://user-images.githubusercontent.com/48505160/66088166-900f1d00-e5bd-11e9-9f66-78253745afb1.png — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#8?email_source=notifications&email_token=AJPAR265DWMJEXOVQV7PCQLQMUTAXA5CNFSM4I44NEK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAGPDYI#issuecomment-537719265>, or mute the thread https://github.com/notifications/unsubscribe-auth/AJPAR26SX4PZGOCBGCSN4ZLQMUTAXANCNFSM4I44NEKQ .
I tried to just clone this and ran in the codesandbox and webstorm, it seems like something run with the face-api.min.js file, both editors cannot load this file. But I solved it by deleting this file and add a new dependency to the face-api. Anyway, thanks for your reply, really appreciate it.
@yinglanh can you please post the code of how you solved it.
how did you add a dependency to the file face-api?
The HTML has a script tag for the face-api library which is included in this repository.
On Mon, Oct 14, 2019 at 5:45 AM Bea98 [email protected] wrote:
how did you add a dependency to the file face-api?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/8?email_source=notifications&email_token=AJPAR24HGWMVS7VCTNI6NL3QORET3A5CNFSM4I44NEK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBEEEHY#issuecomment-541606431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPAR25CVIAPLXOMXN3FS6TQORET3ANCNFSM4I44NEKQ .
So I'm still getting this error. MY script tag looks like this:
<script defer src="./face-api.min.js"></script>
what's wrong with it
Did you copy the code from the repository to ensure it is the same? Also have you checked the logs in your console to ensure that the path to the face-api library is correct and loading correctly?
On Mon, Oct 14, 2019, 9:01 PM Stanlyhalo [email protected] wrote:
So I'm still getting this error. MY script tag looks like this:
what's wrong with it
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/8?email_source=notifications&email_token=AJPAR2YCUX2KHTGFVJGA3GDQOUP7DA5CNFSM4I44NEK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBHEXJQ#issuecomment-542002086, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPAR26AABA7SMMH2DQAHL3QOUP7DANCNFSM4I44NEKQ .
right! so now I have another problem. I can't run it cause it gives me an eror in the script that says : " document is not defined". How can I fix it? (sorry I'm new at this)
Sounds like you didn't defer your script tag in the HTML.
On Thu, Oct 17, 2019, 3:39 AM Bea98 [email protected] wrote:
right! so now I have another problem. I can't run it cause it gives me an eror in the script that says : " document is not defined". How can I fix it? (sorry I'm new at this)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/8?email_source=notifications&email_token=AJPAR2ZRJL26CNXDP5OFV53QPAQDTA5CNFSM4I44NEK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBPJR4Q#issuecomment-543070450, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPAR2YUEXI4E4YTRIAX74TQPAQDTANCNFSM4I44NEKQ .
I have it's there... and when I run the HTML it doesn't appear anything and gives me this error now: "Failed to load resource: the server responded with a status of 404 (Not Found)" " Uncaught (in promise) Error: failed to fetch: (404) Not Found, from url: http://localhost:63342/models/tiny_face_detector_model-weights_manifest.json at face-api.min.js:1 at face-api.min.js:1 at Object.next (face-api.min.js:1) at n (face-api.min.js:1)"
This is most likely because the root of your server is not at the root of your application. Try changing the path to the 404 files by add ./ at the beginning of them.
On Thu, Oct 17, 2019, 5:13 AM Bea98 [email protected] wrote:
I have it's there... and when I run the HTML it doesn't appear anything and gives me this error now: Failed to load resource: the server responded with a status of 404 (Not Found)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/8?email_source=notifications&email_token=AJPAR27TABT3Y73STW2LBZTQPA3FDA5CNFSM4I44NEK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBPSL7A#issuecomment-543106556, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJPAR2YYZEXBZCRDKTBFOEDQPA3FDANCNFSM4I44NEKQ .
it works now thank you so much!
hey i m getting a script error : faceapi not defined
evenly i added all the faceapi files
could you please help me out
This is most likely because the root of your server is not at the root of your application. Try changing the path to the 404 files by add ./ at the beginning of them.(./models on the javasrcipt)

Uncaught ReferenceError: faceapi is not defined at script.js:4
please help i'm new to git
Hi... can someone please help me with the error experience , the same as @mAasim1026 ..
Hi, I am experiencing an issue. When I Downloaded the files and ran it I got a blank white screen pls help
To me the solution was to put the absolute path on the promisses, linke this: _faceapi.nets.tinyFaceDetector.loadFromUri('/caretas/assets/lib/face-api/models'), becouse when the browser fetchs it it calls http://www.domain.com/your_project/assets/...
Hope it helps!
Has anyone tried this on reactjs? Because, for me, it works when I run the code of WebDevSimplified, but I want to implement it on react. I get errors saying "faceapi is not defined.". I have included the
hey i m getting a script error : faceapi not defined
evenly i added all the faceapi files
![]()
could you please help me out
you can use the live server .
please dont send your mail to me
On Sun, Aug 16, 2020 at 4:35 AM Mert ERGÜDEN [email protected] wrote:
hey i m getting a script error : faceapi not defined [image: Screenshot (77)] https://user-images.githubusercontent.com/49087609/71233135-a2763880-231a-11ea-83b3-870b1790f83b.png evenly i added all the faceapi files [image: Screenshot (78)] https://user-images.githubusercontent.com/49087609/71233168-ba4dbc80-231a-11ea-9e24-2e921e6680ad.png [image: Screenshot (79)] https://user-images.githubusercontent.com/49087609/71233198-d6e9f480-231a-11ea-834d-3e873d927c6a.png could you please help me out
you can use the live server .
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WebDevSimplified/Face-Detection-JavaScript/issues/8#issuecomment-674455897, or unsubscribe https://github.com/notifications/unsubscribe-auth/AON3XCF6OO7YRDLLXUNMJKLSA4ICTANCNFSM4I44NEKQ .
Hello 1- You can just add scripts in this order:
2- use live-server to open index.html file
Hi, I am experiencing an issue. When I Downloaded the files and ran it I got a blank white screen pls help
hey try this code:- if (navigator.mediaDevices.getUserMedia) { navigator.mediaDevices.getUserMedia({ video: true }) .then(function(stream) { video.srcObject = stream; }) .catch(function(err0r) { console.log("Something went wrong!"); }); }
Insted of this :- // function startVideo() { // navigator.getUserMedia({ video: {} }, // stream => video.srcObject = stream, // err => console.error(err) // ) // }
-> But the main thing is the uncaught error faceapi-not defined.
please how did you solve it ??
@Bea98 may you help me to solve the errors
Hello everyone, I may have found the problem. I had the same error faceapi is not defined. It seems to be caused by the compiler/bundler/local server you are using. I used Parcel when I got the error. Using live server solved it for me.
Another solution I found is using npm live-server. It hosts de root directory as a server so you can host other folders as well.
Hi, I get this error from my p5 (p5.js says: There's an error due to "faceapi" not being defined in the current scope)(and so I get a face api not defined). Is face api and P5.js not compatible? Thanks!
you save my life =))