Hi guys,
I'm trying to parse some HTML code that is returned from a GET API request.
Tried importing the libraries html-dom-parser and marked and adding them to the Javascript configuration. But they are not recognized inside the Javascript code blocks.
What's the right way of importing them?
They probably did import correctly, but Retool has some bugs still with the linter.
You can try adding a jshint comment to remove the lint error.
Hello @juan.guerrero.gbn,
I second what @khill-fbmc says, sometimes there are false errors, have you tested out using the library in a code block to confirm that the code executor does not have access to the library?
Our docs here outline the steps to import and use a JS library. Follow those steps and it should work, it looks like you have things set up correctly from your screenshot.
Very odd, I was playing around with the 'html-dom-parser' library but I was not able to get it to work. It was giving me the same error and not recognizing that parse was being imported and could be passed strings directly.
I found an alternative using another library for HTML parsing that I was able to get to work. It is called 'dom-parser', and is the bottom of my require list. Let me know if this works for you.
Hi,
This works.
Thank you!