Closed mefp closed 2 years ago
Still getting errors with this issue. I'm trying to load the module via Webpack from inside React. Any help would be appreciated. Thank you in advance.
Hi mefp, Did you solve this problem? I guess the problem comes from import the library as javascript module with webpack, the library is intended to be loaded as UMD. ESM will be supported in the future.
I was unable to solve it directly. Instead, I make standard requests from within my React app and manipulate the HTML that is returned. Is there a better way to do it?
Have you tried to include the script in the main html file?
<!--- "VTAugment" will be attached to the global window object. -->
<script src="./node_modules/@virustotal/vt-augment/dist/vt-augment.min.js"></script>
I remember trying that but can't remember why it wasn't working. The ticket for integrating the VT widget was a while ago. But it's working now with my hack and I have full control over styling of every element and click events, etc.
I'm getting a Type Error and I can't figure out why. I'm using the following code inside an component from the Material UI React lib.
onclick
event, inside aThe offending line seems to be the one which instantiates the new
VTAugment
object. It happens both with the declaredoptions
object and with an empty object.I have verified that the querySelector is working and also that the URL I'm passing to the
load
function is valid.Here is the error output: