-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught (in promise) TypeError: forwardFunc is not a function #4
Comments
Take a quick look at this fix, and let me know: tensorflow/tfjs#2329 |
I just pulled down this chapter and ran It appears the issue is local. I'll run the project on my laptop later this afternoon to verify. |
But what could the local issue be when the node/node-toxicity runs perfectly ? |
I did two things to make this work. First was delete the existing package-lock.json and then I changed the dependency for the toxicity model from "@tensorflow-models/toxicity": "^1.2.2" to "@tensorflow-models/toxicity": "1.2.2" (removing the carrot) |
Thanks so much @hermano360 It looks like they might have made a mistake in semver. Do either of you want to do a PR for credit? |
I am still out of luck - I am using the simple an pure node examples. |
@anjanesh - I ran the code through CodeSandbox.io to assure it would work, and it does LINK: https://codesandbox.io/s/chapter2-web-toxicity-ty8qj Hopefully that helps. |
Sounds good @hermano360! Credit where credit is due. I had hoped that the |
So I tried this on my work laptop - Dell Windows 10 with node. It's all working as expected. |
Please see above. You need to delete the package-lock.json file and change the dependency for the toxicity model from "@tensorflow-models/toxicity": "^1.2.2" to "@tensorflow-models/toxicity": "1.2.2" (removing the caret). |
Yes hermano360 - I did that yesterday and reinstalled the node_modules. Still same error. |
Is it the |
learn-tfjs/chapter2/node/node-toxicity works perfectly. learn-tfjs/chapter2/web/web-toxicity returns the forwardFunc error even after trying various things to fix it including hermano360's method. So, now I understand - it probably isn't the node issue but the same web code is working flawlessly on my Windows 10 laptop. So I don't get why it isn't on my MacBook Pro on all browsers - so I thought it had something to do with node. |
That's definitely strange. The error seems to happen when you have two versions of TFJS that are not compatible in the same repo, so maybe clean the npm cache with |
@anjanesh I'm running it on my macBook (Big Sur, Apple M1) Edited for updateI needed to use node v16.7.0 to properly install the packages, otherwise I would error out. |
Today I did
gh repo clone GantMan/learn-tfjs
I did
npm i
at chapter2/web/web-toxicityhttp://localhost:1234/ shows :
Uncaught (in promise) TypeError: forwardFunc is not a function
The text was updated successfully, but these errors were encountered: