VenoBox
VenoBox copied to clipboard
Could not find a declaration file for module venobox
Hi,
I just want to declare this venobox using import like this:
import VenoBox from 'venobox';
But it throws warning:
Could not find a declaration file for module 'venobox'. 'website/node_modules/venobox/dist/venobox.min.js' implicitly has an 'any' type.
Try npm i --save-dev @types/venobox if it exists or add a new declaration (.d.ts) file containing declare module 'venobox';
Hi, I'm not totally sure, but you could try to import VenoBox from /src/venobox.esm.js.
/dist/venobox.min.js is the built and compressed version, not the module.
I have the same error. I have tried the method you suggested but it didn't work.
VenoBox from /src/venobox.esm.js Or VenoBox from /venobox/src/venobox.esm.js
I have the same error. I have tried the method you suggested but it didn't work.
VenoBox from /src/venobox.esm.js Or VenoBox from /venobox/src/venobox.esm.js
Inside my demo is working fine, be sure you have the correct path to the esm.js file, maybe with a starting dot, and that the script type is "module"
<script type="module">
import VenoBox from './js/venobox/src/venobox.esm.js';
console.log(VenoBox);
new VenoBox();
</script>
here a working example: https://codepen.io/nicolafranchini/pen/mdgoBmB