I recently included dom-to-image in my package.json and when attempting to use it in one of my files, I encountered the following line.
import domtoimage from 'dom-to-image';
The error message '
Cannot find module 'dom-to-image'
' is displayed on this line, making me uncertain about how to properly import a JavaScript library.
Interestingly, the library exists in my node_modules directory.