Skip to content
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

Errors with ml5.js code (from prior to 1.0 release)! #167

Open
shiffman opened this issue Jul 11, 2024 · 0 comments
Open

Errors with ml5.js code (from prior to 1.0 release)! #167

shiffman opened this issue Jul 11, 2024 · 0 comments

Comments

@shiffman
Copy link
Member

👋 Hello, ml5.js community!

We noticed that many people have experienced issues with the library recently, seeing errors such as ... is not a function. 😢 This is most likely due to code that was written for the library prior to the recent 1.0 release. The following should help you resolve any errors! 💫 💜

Quick Fix!

In the ml5 library's script tag, change latest to 0.12.2. If you are using p5.js, you can find the script tag in the index.html file of your p5 sketch.

Change this:

<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script>

to this:

<script src="https://unpkg.com/[email protected]/dist/ml5.min.js"></script>

Hope this works! 🤞

Why are there errors?

We recently released a new version of the library, updating from version 0.12.2 to 1.0.1 (yay!!!). The library was re-designed be even friendlier, and included several breaking changes. Some functions from the previous version (0.12.2) no longer exist in 1.0.1. For example, poseNet.on("pose", gotPose) has been removed and changed to bodyPose.detectStart(video, gotPose).

The ml5@latest tag automatically uses the latest version of the library, which is version 1.0.1. If you are on version 1.0.1 and attempt to call a function that has been removed, you will likely see the ... is not a function error. By specifying [email protected] in the script tag, you can continue using the previous version of the library and call the now deprecated functions.

Since we have passed the 1.0.0 landmark, we will be following semantic versioning for future releases. Going forward, we recommend specifying a major version number in the script tag, such as ml5@1. Using ml5@latest might cause issues if and when there are additional breaking changes.

We will still host version** 0.12** of the library, however, it will no longer receive feature updates. We recommend giving the new library a try! The new reference document is a great place to start as well as a collection of example sketches showcasing the models and functions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant