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

how to use the VT Augment widget in ES6 ?! #34

Open
CreativeASAP opened this issue Oct 3, 2023 · 1 comment
Open

how to use the VT Augment widget in ES6 ?! #34

CreativeASAP opened this issue Oct 3, 2023 · 1 comment

Comments

@CreativeASAP
Copy link

I have faced an error when using the VT Augment widget in ES6.
This is the code:
// Start of code
import React, { useEffect, useRef } from "react";
import VTAugment from "@virustotal/vt-augment";

const VTButton = () => {
const containerRef = useRef(null);
const vtaugmentRef = useRef(null);

const handleButtonClick = () => {
if (vtaugmentRef.current) {
vtaugmentRef.current
.load(
"https://www.virustotal.com/ui/widget/html/MTMuMTA3LjEyLjUwfHxpcF9hZGRyZXNzfHx7ImJkMSI6ICIjNGQ2Mzg1IiwgImJnMSI6ICIjMzEzZDVhIiwgImJnMiI6ICIjMjIyYzQyIiwgImZnMSI6ICIjZmZmZmZmIiwgInR5cGUiOiAiZGVmYXVsdCJ9fHxzZXNzaW9ufHxmb3VuZHx8djN8fDE2OTYyNjY1MzV8fGYwZjMxMDQ2MDllZmI3NzU1MzBjMmM4NGEzZTYxZDQxNDcwZWRjMDYxOWEyYzA0ZWU2NzFjZjIxNzgwOWRmZjY"
)
.openDrawer();
}
};

useEffect(() => {
if (containerRef.current) {
vtaugmentRef.current = new VTAugment(containerRef.current, {
mode: "drawer",
});
}
}, []);

return (







);
};

export default VTButton;

// End of code

and this is the error:
Uncaught TypeError: import_vt_augment.default is not a constructor
at VTButton.jsx:20:30
at commitHookEffectListMount (react-dom.development.js:23150:26)
at commitPassiveMountOnFiber (react-dom.development.js:24926:13)
at commitPassiveMountEffects_complete (react-dom.development.js:24891:9)
at commitPassiveMountEffects_begin (react-dom.development.js:24878:7)
at commitPassiveMountEffects (react-dom.development.js:24866:3)
at flushPassiveEffectsImpl (react-dom.development.js:27039:3)
at flushPassiveEffects (react-dom.development.js:26984:14)
at performSyncWorkOnRoot (react-dom.development.js:26076:3)
at flushSyncCallbacks (react-dom.development.js:12042:22)

@Derekt2
Copy link

Derekt2 commented Apr 3, 2024

same problem here, unable to import in Vue.js framework via import VTAugment from "@virustotal/vt-augment";

My guess is this is unsupported as UMD is only option provided

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

2 participants