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
load function is marked deprecated with message saying to use function returned by load #2786
Comments
You are likely importing the default export: import cheerio from 'cheerio'; This will import a pre-loaded instance of cheerio, which can lead to subtle bugs and issues. Instead, try import * as cheerio from 'cheerio' or import { load } from 'cheerio' Hope this helps! |
Re-opening this as the default export should probably be removed. |
Any progress on this one? |
See my response above. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I believe c370f4e marked the exported load function as deprecated in error. It looks like the documentation was simply copied from the export of a
Cheerio
constructor over to the load function, including a deprecation message that made sense if someone was using the constructor, but is confusing whenload
is used.As an example the following code:
produces the following JSDoc documentation in code editors:
As best I can tell, this example uses the same method of loading html as is what is shown in the project documentation.
If this was not intentional, could we update the JSDoc to remove this deprecation warning and maybe update the function description?
If it is, could the project documentation we updated to indicated what is now the preferred method of loading and parsing HTML?
The text was updated successfully, but these errors were encountered: